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 - Message to Shopper

With any of the three variations of the jsship.snp file it is possible to create a special message to the shopper to let them know their purchase has qualified them for FREE shipping. We need only to add an additional couple of lines to jsship.snp as well as add a few lines to shipmenu.snp.

Reopen your previously modified jsship.snp file. (We are going to use the first one as our example here but this can be done with any of them.) Locate the following lines of code:

function GetShippingCharge(nIndex)
{
  // RealCartUniversity FREE Shipping if order is

Just before the first line add the following:

var freeShip = false;

Now in the part that we modified earlier in this course please locate the line(s) return nShipCharge;. Just before each of these lines (you may only have one) we are going to insert the line: freeShip = true;. Your code should now look like this:

// Returns the charge for shipping based on
// the shipping type at a given index within
// shipping drop menu.
var freeShip = false;
function GetShippingCharge(nIndex)
{
  // 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;
    freeShip = true;
    return nShipCharge;
  }

  // end RealCartUniversity FREE shipping routine.

Next we will make some changes to your shipmenu.snp. Before we get started you should make a copy of shipmenu.snp.

Clone shipmenu.snp

Clone the file shipmenu.snp and then open the cloned copy in your current theme folder in a text editor. (Be sure line wrapping, or word wrapping is turned off.) Locate the following lines of code. They will be last five or six lines of the snippit file. You are looking for:

      document.write("</SELECT>");

      </script>
    </td>
  </tr>
<!-- end of file shipmenu.snp - - - - - - - - - - - - - - - - - -

We are going to add several lines of JavaScript code to the bottom of the JavaScript routine in shipmenu.snp. (NOTE: Older versions of RealCart will have a slightly different version of the document.write statement 6th line from the bottom: document.write("</SELECT>"). It may appear like this: document.write("</SELECT></td></tr>") instead. This is OK because we are not going to modify this line.

The lines to add to the bottom portion of shipmenu.snp are in bright blue.

      document.write("</SELECT>");

if(freeShip)
{
  document.write("</td></tr><tr><td colspan=2>");
  document.write("<center><b><font size=3 color=blue>");
  document.write("<marquee>CONGRATULATIONS! You have ");
  document.write("qualified for FREE SHIPPING ... Please ");
  document.write("select your Free Shipping method above...");
  document.write("</marquee></b><br><font size=1 color=black>");
  document.write("*Please note that some Premium Shipping<br>");
  document.write("methods may require additional shipping ");
  document.write("charges.<br></center></font></font>");
}
      </script>
    </td>
  </tr>
<!-- end of file shipmenu.snp - - - - - - - - - - - - - - - - - -

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 the new lines added to the bottom portion of the shipmenu.snp file. To see the entire modified jsship.snp file please click here. To see the entire modified shipmenu.snp file please click here. The changes in both files are highlighted with red type. You may download this modified jsship4.zip file, extract it and then save the new jsship.snp file to your current theme folder called jsship.snp. You may do the same with this shipmenu.zip file, extract it and then save the new shipmenu.snp file to your current theme folder called shipmenu.snp. Rebuild Checkout, republish and enjoy.

On orders that qualify for FREE shipping the bottom of your checkout page will now look like this:

Select shipping:

CONGRATULATIONS! You have qualified for FREE SHIPPING ... Please select your Free Shipping method above...
*Please note that some Premium Shipping
methods may require additional shipping charges.

Feel free to experiment with this function. You can always start over by re-cloning the original shipmenu.snp and starting over. If you would like to change what the scrolling message says simply change the words to something else. Keep in mind that all of the quotes ("), semi-colons (;) and parenthesis (( and )) must remain exactly as they are pictured above or you will get JavaScript errors and the message will not appear correctly on orders that qualify for FREE shipping.

This concludes the course on FREE Shipping based on Order Total.

<<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