Jump to content


Photo

flat shipping cost depending on amount entered


  • This topic is locked This topic is locked
1 reply to this topic

#1 ffox32

ffox32

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 20 November 2002 - 03:11 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

#2 sshiller

sshiller

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 30 November 2002 - 03:05 PM

Fred,

This applies to HTML code but the variables should work in your js:

Yes, you can ultilize the variable shipping preference feature to have the buyer choose which area and shipping amount to charge per transaction.

You can turn off the shipping calculator all together and add the necessary shipping variables to the HTML code of your shopping cart buttons.

To review your shipping calculation for your account, please follow these steps:

1. Log into your account at https://www.paypal.com by entering your email address and password in the Member Login box. This will take you to the "My Account" page.

2. Click the "Profile" subtab.

3. Click the "Shipping Calculations" link in the "Selling Preferences" column.

4. Click on the "Edit" button.

At the bottom of this page you'll notice two box selections:

Check the top box to disable the shipping calculator .

(Top Box)
Click here to disable the shipping fee calculation listed above. Leave unchecked if you wish to have the shipping amounts passed in from PayPal Shopping Cart Purchases, Single Item Purchases, or Donations.

Bottom Box: Don't worry about this setting since your're not using both the shipping calculator and the shipping variables together.

(Bottom Box)
The following box setting is for using the shipping calculator plus the added shipping variables.

Here's a drop down menu shipping preference selection example you can use to have the buyer select their shipping preference Charge Amount:

If you notice that the following was added to the end of our add to cart HTML code.

Please Select Your Shipping Preference:
<select name="shipping">
<option value="3.00">Domestic - $3.00 </option>
<option value="5.00">International - $5.00</option>
</select>

Button starts here:

<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="YourEmailAddress">
<input type="hidden" name="item_name" value="Test">
<input type="hidden" name="amount" value="$.01">
<input type="image" src="https://www.paypal.com/images/sc-but-03.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" width="106" height="24">
<input type="hidden" name="add" value="1">
Please Select Your Shipping Preference:
<select name="shipping">
<option value="3.00">Domestic - $3.00 </option>
<option value="5.00">International - $5.00</option>
</select>
</form>

Button ends above:


You can change, "Please Select Your Shipping Preference," or " Domestic, International and the dollar amounts to whatever you want."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users