Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shipping Insurance Calculation 1

Status
Not open for further replies.

doubleimpact

Technical User
Oct 19, 2004
4
US
I am working on a basic checkout page for some future ebaying we would like to do. I have several calculations on the page that seem to work, ok. Improvements welcome.

1)At the moment, I am stuck, but trying to find a simple way to calculate optional shipping insurance. The customer should click on a check box and the javascript calculate the insurance price and put it into variable shipins. I also want to be able to have control over at least two variables, The rate per increment and the increment level. At the moment it is $2.00 (rate) per $100 (increment) of the total of the winning bid. (winbidamount)

I have a very rough version of the page available at: It is still very rough, but it may help you to see the actual page.

I am not a programmer, but can follow basics if I can see the variables.

2)I would like the grand total to be an script that validates the form and then calculates the total for the customer based on their preferences.
3)If anyone knows how I can pull ebay information such as item description and ending price over based on item number that would be great, too.

Whatever help you provide is appreciated. Thanks in advance
Brian D. Eldridge
Double Impact,
 
1)
Code:
var inc = 100; // increment
var fee = 2; // fee per increment
function getInsurance(amount)
{
  var total = parseInt(amount);
  total += Math.floor(amount/inc) * fee;
  return total;
}

2)
Do you have more information about the fields you needed validated and what they must conform to, how to calculate the total, etc.?

3)
Cannot be done through Javascript, must be done server-side.

Good luck!

--Chessbot

"So it goes."
Kurt Vonnegut, Slaughterhouse Five
 
Out of topic, but why would you offer
"No shipping Insurance (free)"...

It sounds funny.
It sounds like normally you would charge for "No shipping Insurance" but this time you are giving it free...

I would guess people would normally use "free" as something of value given at no extra cost.

It's nothing technical, just the wording.....

Now for the tek part...
3) you need to check the Ebay Developers Area.

with the eBay API, you communicate directly with the eBay database in XML format. By using the API, your application can provide a custom interface, functionality and specialized operations not otherwise afforded by the eBay interface.



Using the API, you can create programs that:

Submit items for listing on eBay
Get the current list of eBay categories
View information about items listed on eBay
Get high bidder information for items you are selling
Retrieve lists of items a particular user is currently selling through eBay
Retrieve lists of items a particular user has bid on
Display eBay listings on other sites
Leave feedback about other users at the conclusion of a commerce transaction



Good Luck.....





grtfercho çB^]\..
"Imagination is more important than Knowledge" A. Einstein
-----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top