Paypal Configuration (Shipping Calculation)

Example: (advance level worker)

Product Name: Obama USA 2012 T-shirt

Sale Price : $12.12
Regular Price: $20.00

Sizes: Small, Medium, Large,
Extra-Large, XXL, XXXL, 4XL

Colors: Ash, Navy Blue, Obama Blue, Red and White

Shipping and Handling is
——————————————————————
$4.00 for each t-shirts.

======================================

Product Name: Obama Flag 2012 T-shirt 100% Cotton

Sale Price : $12.12
Regular Price: $20.00

Sizes: Small, Medium, Large, Extra-Large, XXL, XXXL, 4XL

Colors: White

Shipping and Handling is
——————————————————————
$4.00 for each t-shirts.
=======================================

If your order is more than $50.00,
shipping is free within the United States and Puerto Rico.

=======================================

Product Name: Obama 2012 Wristband, made 100% silicone

Sale price:  $1.00
Regular Price:  $2.00

Shipping
——————————————————————
$1.00 for the first five(5)wristbands,
$3.00 for five(5) wristbands or more.

[code lang=”js”]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// Shipping senario 1
$(‘#quantity’).change(function(){

var quan = $(this).val();
var ship_cost = 4;
var unit_amount = $(‘#amount’).val();

var total_amount = quan * unit_amount;

if ($(‘#country’).val() == "United States" || $(‘#country’).val() == "Puerto Rico"){
if(total_amount > 50)
ship_cost = 0;
}

//alert($ship_cost);
var total_ship_cost = quan * ship_cost;
//alert(total_ship_cost);

$(‘#shipping’).val(total_ship_cost)

});

$(‘#country’).change(function(){

//alert($(this).val());

var quan2 = $(‘#quantity’).val();
var ship_cost2 = 4;
var unit_amount2 = $(‘#amount’).val();

var total_amount2 = quan2 * unit_amount2;

if ($(‘#country’).val() == "United States" || $(‘#country’).val() == "Puerto Rico"){
if(total_amount2 > 50)
ship_cost2 = 0;
}

//alert(ship_cost2);

//alert($ship_cost);
var total_ship_cost2 = quan2 * ship_cost2;
//alert(total_ship_cost2);

$(‘#shipping’).val(total_ship_cost2)

});

// Shipping senario 2
$(‘#quantity2’).change(function(){

var quan = $(this).val();
//alert(quan);
if(quan >5)
var ship_cost = 3;
else
var ship_cost = 1;

//alert(ship_cost);

var unit_amount = $(‘#amount2’).val();

var total_amount = quan * unit_amount;

if ($(‘#country2’).val() == "United States" || $(‘#country2’).val() == "Puerto Rico"){
if(total_amount > 50)
ship_cost = 0;
}

//alert($ship_cost);
var total_ship_cost = quan * ship_cost;
//alert(total_ship_cost);

$(‘#shipping2’).val(total_ship_cost)

});

$(‘#country2’).change(function(){

//alert($(this).val());

var quan2 = $(‘#quantity2’).val();
//alert(quan2);
if(quan2 >5)
var ship_cost2 = 3;
else
var ship_cost2 = 1;

//alert(ship_cost2);

var unit_amount2 = $(‘#amount2’).val();

var total_amount2 = quan2 * unit_amount2;

if ($(‘#country2’).val() == "United States" || $(‘#country2’).val() == "Puerto Rico"){
if(total_amount2 > 50)
ship_cost2 = 0;
}

//alert(ship_cost2);

//alert($ship_cost);
var total_ship_cost2 = quan2 * ship_cost2;
//alert(total_ship_cost2);

$(‘#shipping2’).val(total_ship_cost2)

});

});
</script>
</head>

<body>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="erriclbeasley@vidaterrainvestments.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Obama USA 2012 T-shirt">
<input type="hidden" name="item_number" value="001">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">

<table style="font-size:15px; color:#666; border:1px solid #F00; background:#CCC; padding:10px; margin-bottom:20px;">
<h2 style="color:#00F;">Shopping Cart</h2>

<tr><td>Product Name: Obama USA 2012 T-shirt</td></tr>
<tr><td>Sale price $12.12</td></tr>
<tr><td>Quantity:</td></tr><tr><td><select name="quantity" id="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
</select>
</td></tr>
<tr><td><input type="hidden" name="on0" value="Sizes">Sizes</td></tr><tr><td><select name="os0">
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="Extra-Large">Extra-Large</option>
<option value="XXL">XXL</option>
<option value="XXXL">XXXL</option>
<option value="4XL">4XL</option>
</select> </td></tr>
<tr><td><input type="hidden" name="on1" value="Colors">Colors</td></tr><tr><td><select name="os1">
<option value="Ash">Ash</option>
<option value="Navy Blue">Navy Blue</option>
<option value="Obama Blue">Obama Blue</option>
<option value="Red">Red</option>
<option value="White">White</option>
</select> </td></tr>
<tr><td>
<input type="hidden" name="on2">Select Country:&nbsp;&nbsp;
<SELECT name="os2" id="country">
<OPTION value="United States" selected>United States</OPTION>
<OPTION value="Puerto Rico">Puerto Rico</OPTION>
<OPTION value="Non UK and PR">Non UK and PR</OPTION>
</SELECT>
</td></tr>
</table>
<input type="hidden" name="amount" id="amount" value="12.12">
<input type="hidden" name="shipping" id="shipping" value="4">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="Small">
<input type="hidden" name="option_amount0" value="12.12">
<input type="hidden" name="option_select1" value="Medium">
<input type="hidden" name="option_amount1" value="12.12">
<input type="hidden" name="option_select2" value="Large">
<input type="hidden" name="option_amount2" value="12.12">
<input type="hidden" name="option_select3" value="Extra-Large">
<input type="hidden" name="option_amount3" value="12.12">
<input type="hidden" name="option_select4" value="XXL">
<input type="hidden" name="option_amount4" value="12.12">
<input type="hidden" name="option_select5" value="XXXL">
<input type="hidden" name="option_amount5" value="12.12">
<input type="hidden" name="option_select6" value="4XL">
<input type="hidden" name="option_amount7" value="12.12">
<input type="hidden" name="option_index" value="0">
<input onclick=CalculateShipping(this.form) type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

<!– ############################### Shopping Cart 2 #############################################
====================================================================================================–>

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="erriclbeasley@vidaterrainvestments.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Band">
<input type="hidden" name="item_number" value="002">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">

<table style="font-size:15px; color:#666; border:1px solid #F00; background:#CCC; padding:10px; margin-bottom:20px;">
<h2 style="color:#00F;">Shopping Cart</h2>
<tr><td>Obama 2012 Wristband</td></tr>
<tr><td>Sale price $1.00 </td></tr>
<tr><td>Quantity:</td></tr><tr><td><select name="quantity" id="quantity2">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="60">60</option>
<option value="70">70</option>
<option value="80">80</option>
<option value="90">90</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
<option value="250">250</option>
<option value="300">300</option>
<option value="350">350</option>
<option value="400">400</option>
<option value="450">450</option>
<option value="500">500</option>
</select>
</td></tr>

<tr><td>
<input type="hidden" name="on2">Select Country:&nbsp;&nbsp;

<SELECT name="os2" id="country2">
<OPTION value="United States" selected>United States</OPTION>
<OPTION value="Puerto Rico">Puerto Rico</OPTION>
<OPTION value="Non UK and PR">Non UK and PR</OPTION>
</SELECT>
</td></tr>
</table>
<input type="hidden" name="amount" id="amount2" value="1.00">
<input type="hidden" name="shipping" id="shipping2" value="1.00">
<!–<input type="hidden" name="shipping2" value="3.00">–>
<input type="hidden" name="option_index" value="0">
<input onclick=CalculateBand(this.form) type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</body>
</html>
[/code]

Download: shipping-calculation