Jump to content


Photo

flat shipping fee depending on amount


  • This topic is locked This topic is locked
2 replies to this topic

#1 ffox32

ffox32

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 20 November 2002 - 03:08 PM

To Whom It May Concern:
I am working with a website that is using paypal. I was able to use a js file and the code pretty much from example: CASE 1 on the http://members.aol.com/paypalhelper/ page. I have posted what I am doing at www.jamiionline.com/pay.html. It is supposed to work like western union. You send an amount threw the single item purchase page but I need to set breakpoints fixed at $100, $200, $300 and $400 and so forth. So that when you send 100 dollars it adds 10 for a shipping fee, 20 for 200 dollars and so forth. Is there a way to send that
information from the pay.html page I have or do I need to create if
statments in javascript in the js file that I am using if so how do I go
about doing that. To make paypal add the right shipping calculation. I have added the js file text I am using below for reference.

Any help in this matter would be greatly appreciated
-Fred







// Support construction of dynamic PayPal args.
var blk1 = "https://www.paypal.com/cgi-bin/webscr" +
"?cmd=_cart";
var blk1a = "&add=1";
var blk1d = "&display=1";
var blk2 = "&business=ffox32@hotmail.com";
var blk3 = "&item_name=";
var blk3n = "Test";
var opt0a = "&on0=account+number";
var opt0b = "&os0=";
var opt0v = "test";
var blk4 = "&amount=";
var blk4a = "6.66";
var blk5 = "&image_url=http%3a//" +
"members.aol.com/paypalhelper/mylogo.jpg"
var winpar = "width=600,height=400,scrollbars," +
"location," + // some users delete this
"resizable,status";

function AddBoth (strn1, strn2, arg) { // add to both fields
AddStyle (strn1, "0"); // add to description
AddPrice (strn2, arg); // add to price
}

function AddPrice (strn, arg) { // add to current price
var r1,r2,pos;
r1 = blk4a * 1.0 + 0.005; // float 'em
r2 = strn * 1.0;
strn = escape (r1 + r2); // add and put back to string
pos = strn.indexOf ("."); // find decimal point
blk4a = strn.substring (0, pos + 3); // lop off extra
if (arg != "0") CallPay ();
}

function AddStyle (strn, arg) { // add to current description
blk3n = blk3n + "%2C%20" + escape (strn);
if (arg != "0") CallPay ();
}

function CallPay () { // call the PayPal shopping cart
window.open (blk1 + blk1a + // open the cart window
blk2 + blk3 + blk3n + opt0a + opt0b + opt0v +
blk4 + blk4a + blk5,
"paypal",
winpar);
}

function CallView () { // call the PayPal shopping cart view
window.open (blk1 + blk1d + // open the PayPal cart window
blk2,
"paypal",
winpar);
}

function MakeBuy (obj1) { //get form data for PayPal
var ItemName,desc;

ItemName = obj1.elements[0].value; // get the entry form values
SetPrice (obj1.elements[2].value);
opt0v = escape (obj1.elements[1].value); // set option value

desc = (ItemName + " " );
// lnam + ", " +
//addr + ", " +
// city + " " +
// zip


SetDesc (desc); // set the PayPal description field

CallPay ();
}

function SetBoth (strn1, strn2, arg) { // set desc and value
SetDesc (strn1);
SetPrice (strn2);
if (arg != "0") CallPay ();
}

function SetDesc (strn) { // set the desc field
blk3n = escape (strn);
}

function SetPrice (strn) { // set the current price
blk4a = "0.00";
AddPrice (strn, "0");
}


Fox
  • JessieMt likes this

#2 PayPalStephen

PayPalStephen

    Advanced Member

  • Members
  • 2,138 posts

Posted 21 November 2002 - 03:49 PM

You may try to use the SIP code. You can set it up with a pull down menu and have it work like you want. Here is an example of what you can do.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUREMAILADDRESS">
<input type="hidden" name="item_name" value="Money Order by 100.00">
<input type="hidden" name="item_number" value="test">
<select name="quantity">
<option value="1">100.00
<option value="2">200.00
<option value="3">300.00
<option value="4">400.00
</select>
<input type="hidden" select_name="quantity" value="">
<input type="hidden" name="amount" value="100.00">
<input type="hidden" name="shipping" value="10.00">
<input type="hidden" name="shipping2" value="10.00">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypal.com/images/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" width="68" height="23">
</form>

Stephen Ivaskevicius
PayPal/eBay, Inc.

#3 paypal_pb

paypal_pb

    Advanced Member

  • Members
  • 2,960 posts

Posted 25 November 2002 - 11:06 AM

Another approach:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUREMAILADDRESS">
<input type="hidden" name="item_name" value="Money Order">
<input type="hidden" name="item_number" value="test">
<select name="amount">
<option value="110.00">100.00
<option value="220.00">200.00
<option value="330.00">300.00
<option value="440.00">400.00
</select>
<input type="hidden" select_name="quantity" value="">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypal.com/images/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" width="68" height="23">
</form>

I likw Stephen's better, though.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users