Jump to content

USPS Shipping


Guest loren antolik

Recommended Posts

Guest loren antolik

okay, after doing some research, insurance is an additional charge that cubecart does not consider. i am building my own code to calculate the insurance. this block of code calculates the insurance charge based on the order amount (subTotal). you can apply this insurance charge to the rates that are returned from the usps

$zip_dest = $basket["delInf"]["postcode"];

$countryName = countryName($basket['delInf']['country']);

if($api=="IntlRate") {

// get the config

$module = fetchDbConfig("USPSINT");

if ( $countryName == "Canada" ) {

if ( $subTotal <= 50 ) {

$insuranceCharge = 1.35;

} else if ( $subTotal <= 100 ) {

$insuranceCharge = 2.30;

} else if ( $subTotal <= 675 ){

$insuranceCharge = 2.30 + ( ( ( $subTotal - ( $subTotal % 100 ) ) / 100 ) * 1.05 );

} else {

$insuranceCharge = 8.60;

}

} else {

if ( $subTotal <= 50 ) {

$insuranceCharge = 1.95;

} else if ($subTotal <= 100 ) {

$insuranceCharge = 2.75;

} else {

$insuranceCharge = 2.75 + ( ( ( $subTotal - ( $subTotal % 100 ) ) / 100 ) * 1.05 );

}

}

} else {

// get the config

$module = fetchDbConfig("USPS");

if ( $subTotal <= 50 ) {

$insuranceCharge = 1.35;

} else if ($subTotal <= 100 ) {

$insuranceCharge = 2.30;

} else {

$insuranceCharge = 2.30 + ( ( ( $subTotal - ( $subTotal % 100 ) ) / 100 ) * 1.05 );

}

}

Link to comment
Share on other sites

  • 2 months later...
Guest Duckie

does this go into the calc.php? and are the customers able to choose to have insurance or not?, also for US, you would change the varible in the code?

sorry fo all the questions, this would be a good addition to the shipping end

Link to comment
Share on other sites

This would make a great mod if the customer had the choice to take the insurance. Many customers do not like to be forced to purchase insurance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...