UPS Shipping by Weight and Zone

Completed modifications to the NOP Shopping Cart. Additions, modifications, and more.

Moderators: Koibito, Stefko, Randy, Rosey

UPS Shipping by Weight and Zone

Postby Stefko on Sun Feb 23, 2003 4:17 pm

Here you will find a working demo which may be viewed and tested:

http://shopdemo.totalprintingsolutions.com/demo20
Note: try all radio buttons to see cart in action!! This cart represents a company store, but with a map added, the customer will be able to determine his/her shipping zone.

Download the nopcart javascript here:

http://shopdemo.totalprintingsolutions. ... opcart.zip


Documentation and instructions will be available in the near future, this script may be modified for your UPS Zone and weight charges!!

See Update Below

EDIT 9-6-2009: While this site no longer exist, the archive does, see attached
Attachments
nopcart.zip
NOP v4.4 w/ UPS Mod v.1.3
(10.24 KB) Downloaded 99 times
Last edited by Stefko on Sun Mar 02, 2003 5:03 pm, edited 1 time in total.
KFL Technologies
IT Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 787
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Postby Guest on Wed Feb 26, 2003 12:27 pm

very good, thanks for sharing, I am shortly going to be writing my own little script for shipping per specific weight. i.e up to 20 kilos is £10.00 and 40p per kilo extra. I will be able to modify yours and save some time.
I just thought of something, I want to use drop down menus which vary price with product size, but also the weight varies with size, any ideas how to implement?
Guest
 

Postby justin on Fri Feb 28, 2003 3:16 pm

Guest - Use winkphoto's addoneofmanytocart function if you wish to use this shipping matrix with a variable drop down menu which vary's size, weight and price etc.

This shipping mod works very well and I have modified to suit my needs, thanks Stefko.
I do think though that var weight should be rounded off to 3 significant figures. It deosn't look so good if your total weight on the checkout page shows something like 138.68999999999997 lbs/kgs.
justin
 
Posts: 53
Joined: Fri Nov 29, 2002 4:35 pm
Location: UK

Update to Shipping Mod

Postby Stefko on Sun Mar 02, 2003 4:46 pm

UPDATE 3 (5-04-03)

Corrected MathRound on Weight

FIND IN MANAGECART FUNCTION & CHECKOUTCART FUCTION

Code: Select all
fWeight += (parseInt(fields[1]) * parseFloat(fields[4]) * 100)/100; 


REPLACE WITH THIS CODE

Code: Select all
fWeight += (parseInt(fields[1]) * parseFloat(fields[4]) );
fWeight = Math.round(fWeight * 100)/100; 


(note: change the two 100's to 1000 if you prefer a three digit weight!)

-----------------------------------------------------------------------------------------------------------------------------------

UPDATE 2 (3-28-03)

Bug Fixes:

REPLACE YOUR RADIOCHECKED FUNCTION W/ THIS ONE!

Code: Select all
//---------------------------------------------------------------------||
// FUNCTION:    RadioChecked                                           ||
// PARAMETERS:  Radio button to check                                  ||
// RETURNS:     True if a radio has been checked                       ||
// PURPOSE:     Form fillin validation                                 ||
//---------------------------------------------------------------------||
function RadioChecked( radiobutton ) {
   var bChecked = false;
   var rlen = radiobutton.length;
   for ( i=0; i < rlen; i++ ) {
      if ( radiobutton[i].checked )
         bChecked = true;
   }   
   return bChecked;
}


--------------------------------------------------------------------------------------------------------------------------------------
REPLACE YOUR VALIDATECART FUNCTION W/ THIS ONE!

Code: Select all
//---------------------------------------------------------------------||
// FUNCTION:    ValidateCart                                           ||
// PARAMETERS:  Form to validate                                       ||
// RETURNS:     true/false                                             ||
// PURPOSE:     Validates the managecart form                          ||
//---------------------------------------------------------------------||
var g_TotalCost = 0;
function ValidateCart( theForm ) {
   if ( TaxByRegion ) {
      if ( !RadioChecked(eval("theForm."+OutputOrderTax)) ) {
         alert( TaxPrompt );
         return false;
      }
   }

   if ( isNaN (g_TotalCost) ) {
      alert( NoQtyPrompt );
      return false;
   }

   if ( MinimumOrder >= 0.01 ) {
      if ( g_TotalCost < MinimumOrder ) {
         alert( MinimumOrderPrompt );
         return false;
      }
   }

   if ( !RadioChecked(theForm.ZONE) ) {
      alert( LocationPrompt );
      return false;
   }

   return true;
}


-----------------------------------------------------------------------------------------------------------------------------------
Replace this Taxable and Non-taxable code:

Code: Select all
var strProductId = fields[0];
if( strProductId[0] != 'n' ) {
fTax += (parseInt(fields[1]) * parseFloat(fields[2]) ) * TaxRate;


With this code:

Code: Select all
var strProductId = fields[0];
strProductId=strProductId.charAt(0);
if( strProductId!= 'n' ) {
fTax += (parseInt(fields[1]) * parseFloat(fields[2]) ) * TaxRate;


-----------------------------------------------------------------------------------------------------------------------------------
UPDATE 1

A fix has be made to allow Netscape and Opera browsers to function correctly using this mod. The downloadable zip file has been updated, so I post this for those who have already started using this mod.

Find these lines:

Code: Select all
LocationSelected = GetCookie("ZoneSelected");
//if (LocationSelected == null) LocationSelected = 0; // Code to use Local  Area as default checked, but not needed because want null selected at this time ||
if (LocationSelected != null) document.all.ZONE[LocationSelected].checked = true;

And replace with these lines:

Code: Select all
LocationSelected = GetCookie("ZoneSelected");
//if (LocationSelected == null) LocationSelected = 0; // Code to use Local  Area as default checked, but not needed because want null selected at this time ||
if (LocationSelected != null) {
    var cLocations = document.getElementsByName('ZONE');
    for (var iCtr = 0; iCtr < cLocations.length; iCtr++) {
         if (cLocations[iCtr].value == LocationSelected) cLocations[iCtr].checked = true;
    }
}



Aslo added the Taxable and Non-taxable Mod (products ids starting "n" are non-taxable) and set the weight to round to the nearest hundredth.
Code: Select all
Last edited by Stefko on Sun May 04, 2003 2:27 pm, edited 3 times in total.
KFL Technologies
IT Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 787
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Postby justin on Tue Mar 04, 2003 2:12 pm

Thanks again for all your hard work.
justin
 
Posts: 53
Joined: Fri Nov 29, 2002 4:35 pm
Location: UK

Postby vmaster on Sun Mar 23, 2003 12:53 pm

The UPS shipping mod is EXCELLENT :D :D :D .

Is there any way of avoiding the $NaN.aN appearing when the user has not selected any shipping zone. Maybe it could stay blank, or the cart defaults to Zone 1 automatically. Please advise.
vmaster
 
Posts: 2
Joined: Sat Mar 22, 2003 4:34 pm

Postby Stefko on Sun Mar 23, 2003 1:12 pm

Thanks, find this in the managecart function of the js file, remove the comment which is marked in red!


LocationSelected = GetCookie("ZoneSelected");
//if (LocationSelected == null) LocationSelected = 0; // Code to use Local Area as default checked, but not needed because want null selected at this time ||

This makes "0" the default and can be changed to which ever you wish!!
KFL Technologies
IT Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 787
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Postby vmaster on Sun Mar 23, 2003 1:19 pm

Brilliant - that works perfectly !!! :D
vmaster
 
Posts: 2
Joined: Sat Mar 22, 2003 4:34 pm

how to implement more radiobuttons (with different options)

Postby ...ET... on Tue Mar 25, 2003 4:01 pm

Hi,

I was trying to implement two more radio buttons to offer a choice between MP3/Tape for the shoppers.
But it seems that (after copying the code for the shipping matrix) the radio's behave strangely. This is of course because of me.

What i dont understand is the following line in the nopcart :
GetCookie(ZoneSelected).
Where comes this ZoneSelected from ???
I cannot not find it anyware.

What do i need to code, and where, to make two new radio's in the managecart page.?
...ET...
 

Postby Stefko on Tue Mar 25, 2003 4:07 pm

Once a Zone has been selected it is stored as a cookie

I am still trying to work out the problem with two sets of Radio Buttons (thats why the state tax is included within one of the zones!!

I will work on this problem and post an update when I have worked it out
KFL Technologies
IT Solutions
e-Commerence Solutions
Stefko
Contributor / Guru
 
Posts: 787
Joined: Wed Sep 18, 2002 1:11 am
Location: Wichita, KS

Tried to add two radio sets

Postby ...ET.... on Tue Mar 25, 2003 5:28 pm

)Hi Stefko,

I was trying and trying, and i succeeded in making two sets of radio's on the Managacart page...
I will share you the code at the end.

What i am trying to accomplish is the following.
On the items page, people can choose from 500 lectures.
(too bad that i cannot use one submit button yet :? )

Then on the managecart page people have to choose between
Shipping within europe/outside europe AND
between MP3 and Tape for the media.

For now the choice of MP3 and Tape function does not do anything yet, but i will use it to calculate additional media costs and also the weight... (i hope). At least is has no errors.

Basically i just "borrowed" your code to make a new set of buttons, which are also stored in a cookie. So much for invention!! :P
I think you mean that you would like to store the radio buttons in the existing cookie.

What is also BOTHERING ME INSANE, is that IE and Opera behave differently on forms.... GGRRRRR
Anyway..



Here is the Nopcart code :

This goes in the top with the vars
Code: Select all
//Options for Everyone:
MonetarySymbol = '&#0128 ';
DisplayNotice = true;
DisplayShippingColumn = true;
DisplayShippingRow = true;
TaxRate = 0.000; //set taxable region rate ||
DisplayTaxRow = false;
DisplayWeightRow = false; // Displays total Weight row if set to true ...ET...||
DisplayMediaRow  = true; // Displays the Media type choice if cart is not empty ...ET ||
TaxByRegion = false; //leave this at false, UPS Shipping Mod will activate taxable Zone ||
TaxPrompt = 'For tax purposes, please select if you are an Kansas branch of Oasis before continuing';

//Deactivated ||
TaxablePrompt = 'Kansas Branch'; //Deactivated ||
NonTaxablePrompt = 'Other Branches'; //Deactivated ||
MinimumOrder = 0.01;
MinimumOrderPrompt = 'Oops!\n\nWe can not proceed to check out since\nthere is no item in the shopping cart.';
//original syntax - MinimumOrderPrompt = 'Your order is below our minimum order, please order more before
checking out.';


Code: Select all
//---------------------------------------------------------------------||
// FUNCTION: ManageCart ||
// PARAMETERS: Null ||
// RETURNS: Product Table Written to Document ||
// PURPOSE: Draws current cart product table on HTML page ||
// EXTRAS ADDED IN: Code to enable UPS mod. ||
//---------------------------------------------------------------------||
function ManageCart( ) {
var iNumberOrdered = 0; //Number of products ordered
var fTotal = 0; //Total cost of order
var fTax = 0; //Tax amount
var fWeight = 0; //Weight
var fShipping = 0; //Shipping amount
var fLectures = 0; //Nr of lectures in cookie/cart ...ET... ||
var strTotal = ""; //Total cost formatted as money
var strTax = ""; //Total tax formatted as money
var strShipping = ""; //Total shipping formatted as money
var strOutput = ""; //String to be written to page
var bDisplay = true; //Whether to write string to the page (here for programmers)

iNumberOrdered = GetCookie("NumberOrdered");
if ( iNumberOrdered == null )
iNumberOrdered = 0;

LocationSelected = GetCookie("ZoneSelected");
if (LocationSelected == null) LocationSelected = 0; // Code to use Europe as default checked if customer goes to

Checkout with an empty Cart ||


if ( bDisplay )
strOutput = "<TABLE CLASS=\"nopcart\"><TR>" +
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strILabel+"</B></TD>" +
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strDLabel+"</B></TD>" +
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strQLabel+"</B></TD>" +
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strPLabel+"</B></TD>" +
(DisplayShippingColumn?"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strSLabel+"</B></TD>":"") +
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strRLabel+"</B></TD></TR>";

if ( iNumberOrdered == 0 ) {
strOutput += "<TR><TD COLSPAN=6 CLASS=\"nopentry\"><CENTER><BR><B>Your cart is

empty</B><BR><BR></CENTER></TD></TR>";
}

for ( i = 1; i <= iNumberOrdered; i++ ) {
NewOrder = "Order." + i;
database = "";
database = GetCookie(NewOrder);

Token0 = database.indexOf("|", 0);
Token1 = database.indexOf("|", Token0+1);
Token2 = database.indexOf("|", Token1+1);
Token3 = database.indexOf("|", Token2+1);
Token4 = database.indexOf("|", Token3+1);

fields = new Array;
fields[0] = database.substring( 0, Token0 );        // Product ID
fields[1] = database.substring( Token0+1, Token1 ); // Quantity
fields[2] = database.substring( Token1+1, Token2 ); // Price
fields[3] = database.substring( Token2+1, Token3 ); // Product Name/Description
fields[4] = database.substring( Token3+1, Token4 ); // Weight
fields[5] = database.substring( Token4+1, database.length ); //Additional Information

fTotal += (parseInt(fields[1]) * parseFloat(fields[2]) );
fWeight += (parseInt(fields[1]) * parseFloat(fields[4]) );
fWeight = Math.round(fWeight*100)/100;
var strProductId = fields[0];
if( strProductId[0] != 'n' ) {
fTax += (parseInt(fields[1]) * parseFloat(fields[2]) ) * TaxRate;
}

// Count how many items in the cookie/cart are a lecture||
// ID_NUM begins with a x if it is a lecture            ||
//...ET...                                              ||
        var strMT = fields[0];
   strMT=strMT.charAt(0);
        if (strMT == 'x' ) {
   fLectures=(fLectures + 1);
        }
// END of lecture count

strTotal = moneyFormat(fTotal);
strTax = moneyFormat(fTax);

if ( bDisplay ) {
strOutput += "<TR><TD CLASS=\"nopentry\">" + fields[0] + "</TD>";

if ( fields[5] == "" )
strOutput += "<TD CLASS=\"nopentry\">" + fields[3] + "</TD>";
else
strOutput += "<TD CLASS=\"nopentry\">" + fields[3] + " - <I>"+ fields[5] + "</I></TD>";

strOutput += "<TD CLASS=\"nopentry\" ALIGN=CENTER><INPUT TYPE=TEXT NAME=Q SIZE=2 VALUE=\"" + fields[1] + "\"

onChange=\"ChangeQuantity("+i+", this.value);\"></TD>";
strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(fields[2]) + "/ea</TD>";

if ( DisplayShippingColumn ) {
if ( parseFloat(fields[4]) > 0 )
strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>"+ fields[4] + " lbs" + "/ea</TD>";
else
strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>N/A</TD>";
}

strOutput += "<TD CLASS=\"nopentry\" ALIGN=CENTER><input type=button value=\" "+strRButton+" \"

onClick=\"RemoveFromCart("+i+")\" class=\"nopbutton\"></TD></TR>";
}

if ( AppendItemNumToOutput ) {
strFooter = i;
} else {
strFooter = "";
}
if ( HiddenFieldsToCheckout ) {
strOutput += "<input type=hidden name=\"" + OutputItemId + strFooter + "\" value=\"" + fields[0] + "\">";
strOutput += "<input type=hidden name=\"" + OutputItemQuantity + strFooter + "\" value=\"" + fields[1] + "\">";
strOutput += "<input type=hidden name=\"" + OutputItemPrice + strFooter + "\" value=\"" + fields[2] + "\">";
strOutput += "<input type=hidden name=\"" + OutputItemName + strFooter + "\" value=\"" + fields[3] + "\">";
strOutput += "<input type=hidden name=\"" + OutputItemWeight + strFooter + "\" value=\"" + fields[4] + "\">";
strOutput += "<input type=hidden name=\"" + OutputItemAddtlInfo + strFooter + "\" value=\"" + fields[5] + "\">";
}

}

if ( bDisplay ) {
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5><B>"+strSUB+"</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + strTotal + "</B></TD>";
strOutput += "</TR>";

// Show the Media selection row ...ET... ||
if ((DisplayMediaRow) && ( iNumberOrdered != 0 )) {
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=1><B>MEDIA TYPE</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=5>";
strOutput += "<input type=radio name=\"MEDIA\" value=\"0" + "\" onClick=\"MediaCalc(this.value)\">";
strOutput += "MP3";
strOutput += "<BR><input type=radio name=\"MEDIA\" value=\"1" + "\" onClick=\"MediaCalc(this.value)\">";
strOutput += "Tape"; 
strOutput += "</TD>";
strOutput += "</TR>";

document.write(strOutput);
strOutput = "";
}
// END - Show the media selection row ||

// Determine the value of the radiobuttons for MEDIA TYPE ||
Media = GetCookie("MediaType");

if (Media != null) {
    var cMedia = document.getElementsByName('MEDIA');
    for (var iCtr = 0; iCtr < cMedia.length; iCtr++) {
         if (cMedia[iCtr].value == Media) cMedia[iCtr].checked = true;
    }
}

if (Media == 0) MediaLabel = "MP3";
if (Media == 1) MediaLabel = "Tape";

if ((DisplayMediaRow) && ( iNumberOrdered != 0 )) {
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5><B>MEDIA COSTS  (" + MediaLabel + ")</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + strShipping + "</B></TD>";
strOutput += "</TR>";
}

// Displays the shipping matrix and sets the value for each zone ||
if (( DisplayShippingRow ) && ( iNumberOrdered != 0)) {
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=1><B>"+"SHIPPING<BR>ZONE"+"</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=5>";
strOutput += "<input type=radio name=\"ZONE\" value=\"0" + "\" onClick=\"ComputeShipping(this.value,

"+fWeight+")\">";
strOutput += "Zone 1 - Europe";
strOutput += "<BR><input type=radio name=\"ZONE\" value=\"1" + "\" onClick=\"ComputeShipping(this.value,

"+fWeight+")\">";
strOutput += "Zone 2 - Outside Europe"; 
strOutput += "</TD>";
strOutput += "</TR>";

document.write(strOutput);
strOutput = "";
// END - Displays the shipping matrix and sets the value for each zone ||

LocationSelected = GetCookie("ZoneSelected");
//if (LocationSelected == null) LocationSelected = 0; // Code to use Local Area as default checked, but not

needed because want null selected at this time ||
//if (LocationSelected != null) document.all.ZONE[LocationSelected].checked = true;

if (LocationSelected != null) {
    var cLocations = document.getElementsByName('ZONE');
    for (var iCtr = 0; iCtr < cLocations.length; iCtr++) {
         if (cLocations[iCtr].value == LocationSelected) cLocations[iCtr].checked = true;
    }
}

if (LocationSelected == 0) LocationLabel = "Europe";
if (LocationSelected == 1) LocationLabel = "Outside Europe";

if (fWeight == 0) fShipping = 0;
else fShipping = ComputeShipping(LocationSelected, fWeight);

strShipping = moneyFormat(fShipping);

// ...ET...||
if ( DisplayWeightRow ) {
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5><B>"+strWTOT+"</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + fWeight + " lbs" + "</B></TD>";
}
// END     ||

// Display the Shipping location row, and the costs ||
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5><B>" + strSHIP + " " + LocationLabel + "</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + strShipping + "</B></TD>";
strOutput += "</TR>";

}

if (LocationSelected != 0) //sets tax to 0.00 for all areas except 0 ||
fTax = 0.00; 

strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5><B>"+strTOT+"</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + moneyFormat((fTotal +

fShipping + fTax)) + "</B></TD>";
strOutput += "</TR>";

strOutput += "</TABLE>";

if ( HiddenFieldsToCheckout ) {
strOutput += "<input type=hidden name=\""+OutputOrderSubtotal+"\" value=\""+ MonetarySymbol + strTotal + "\">";
strOutput += "<input type=hidden name=\""+OutputOrderShipping+"\" value=\""+ MonetarySymbol + strShipping +

"\">";
strOutput += "<input type=hidden name=\""+OutputOrderTax+"\" value=\""+ MonetarySymbol + strTax + "\">";
strOutput += "<input type=hidden name=\""+OutputOrderTotal+"\" value=\""+ MonetarySymbol + moneyFormat((fTotal +

fShipping + fTax)) + "\">";
}
}
g_TotalCost = (fTotal + fShipping + fTax);

document.write(strOutput);
document.close();
}


//---------------------------------------------------------------------||
// FUNCTION: MediaCalc                                                 ||
// PARAMETERS: Type of Media                                           ||
// RETURNS: Amount of shippingcost / weight of order                   ||
// PURPOSE: Compute Additional media costs for MP3 and/or tape         ||
//---------------------------------------------------------------------||
function MediaCalc(Zone) {
LocationValue = GetCookie("MediaType");

if (LocationValue != Zone) {
SetCookie("MediaType", Zone, null, "/");
location.href=location.href;
}

}



//---------------------------------------------------------------------||
// FUNCTION: ComputeShipping ||
// PARAMETERS: ||
// RETURNS: ||
// PURPOSE: Compute shipping cost due to total weight ||
//---------------------------------------------------------------------||
function ComputeShipping(Zone, TotWeight) {
LocationValue = GetCookie("ZoneSelected");

if (LocationValue != Zone) {
SetCookie("ZoneSelected", Zone, null, "/");
location.href=location.href;
}

if (TotWeight == 0) return 0.00;

if (LocationValue == 0 ) {
if (TotWeight <= 1) return 0.00;
if ((TotWeight <= 500) && (TotWeight > 1)) return (0.00 + (0.00 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 1 ) {
if (TotWeight <= 1) return 8.39;
if ((TotWeight <= 500) && (TotWeight > 1)) return (8.39 + (0.15 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 2 ) {
if (TotWeight <= 1) return 8.50;
if ((TotWeight <= 500) && (TotWeight > 1)) return (8.50 + (0.15 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 3 ) {
if (TotWeight <= 1) return 8.74;
if ((TotWeight <= 500) && (TotWeight > 1)) return (8.74 + (0.20 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 4 ) {
if (TotWeight <= 1) return 8.82;
if ((TotWeight <= 500) && (TotWeight > 1)) return (8.82 + (0.25 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 5 ) {
if (TotWeight <= 1) return 9.02;
if ((TotWeight <= 500) && (TotWeight > 1)) return (9.02 + (0.30 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 6 ) {
if (TotWeight <= 1) return 9.07;
if ((TotWeight <= 500) && (TotWeight > 1)) return (9.07 + (0.45 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 7 ) {
if (TotWeight <= 1) return 9.18;
if ((TotWeight <= 500) && (TotWeight > 1)) return (9.18 + (0.60 * Math.ceil(parseFloat((TotWeight - 1) / 1))));
}
if (LocationValue == 8 ) {
if (TotWeight <= 500) return 20.00;
if ((TotWeight <= 10000) && (TotWeight > 500)) return (20.00 + (6.50 * Math.ceil(parseFloat((TotWeight - 500) /

500))));
}
if (LocationValue == 8 ) {
if (TotWeight <= 500) return 22.00;
if ((TotWeight <= 10000) && (TotWeight > 500)) return (22.00 + (8.00 * Math.ceil(parseFloat((TotWeight - 500) /

500))));
}
}
Code: Select all
Chant Hare Krishna, and be Happy
...ET....
 
Posts: 18
Joined: Tue Mar 25, 2003 5:05 pm
Location: Netherlands

Oops. The managecart table is not written correctly

Postby ...ET....p on Wed Mar 26, 2003 5:04 pm

Hi stefko,

Sorry to inform you that my code was not yet bug free (bzzzzz) :oops:
I still dont know what caused it, but it seems that when i restart the browser, then my table will be messed up.

So i added a variable to the managecart() function :

Code: Select all
if (Media == 0) strMediaLabel = "MP3";
if (Media == 1) strMediaLabel = "Tape";

if (DisplayMediaRow) {
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5><B>MEDIA COSTS "+strMediaLabel+"</B></TD>";
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1><B>TESTING</B></TD>";
strOutput += "</TR>";
}


Hope this helps
...ET....p
 

Shipping by weight and Zone

Postby Maree on Tue May 13, 2003 4:53 am

Hi,

I have tried the mod for shipping but need to add Shipping including Registered post(Insurance)
This requires the shipping charge plus a standard fee as well as a fee for the dollar amount eg :
everything under a $100 is the standard fee
for every $100 or part there above $100 there is an added fee.

Could anyone help me with this I'm not sure how to include the subtotal in the calculations.


Maree :?
Maree
 
Posts: 18
Joined: Sat May 10, 2003 9:40 am
Location: Australia

Postby ...ET.... on Tue May 13, 2003 6:28 am

Your question is not really clear for me.

On what do you base the fee?
Chant Hare Krishna, and be Happy
...ET....
 
Posts: 18
Joined: Tue Mar 25, 2003 5:05 pm
Location: Netherlands

Postby Maree on Tue May 13, 2003 6:35 am

Australia Post based the fee on the value of the Goods to be Insured
all goods up to $100 base fee is $2.15
then for every $100 or part there of $1.00 extra

Does that help

Maree
Maree
 
Posts: 18
Joined: Sat May 10, 2003 9:40 am
Location: Australia

Next

Return to Modifications

Who is online

Users browsing this forum: No registered users and 1 guest