CGI/Pearl - Calculation form 4 e-commerce

They have: 66 posts

Joined: Apr 1999

I have a side gig and my client wants to go e-commerce. He has everything set and now I need to integrate the Web interface with his credit card linking company.

I need a script that will total up amount of products to be ordered and the prices. IE. a user would enter 4 of product B
2 of product L and 8 of product M...then it'll totoal the the order to be sent to the credit card company.

Thanks a bundle!!

They have: 109 posts

Joined: Apr 1999

Hello;
You could use an Associative array (%). Have the info be inputed by a form, but in this case, I will have to put values in for them so you know what im talking about.

$productname="Batman Action Figure";
$price =3.25;
$quantity = 3;
$final = $price * $quantity;
$info{$productname}=$final;

the associative array would be
%info here, and it would contain all of the product names as the keys and the amount as the values.
Than you can print these in a .txt or whatever by

open(IN,"<info.txt");
foreach ( $info{$productname})
{
print IN "$productname:$final\n";
}
close(IN);

I hope this shows up right, and I hope even more that it would work Wink (im still learning too).

----------
[Dass]
[Email:[email protected]]-[ICQ:16560402]

They have: 5,633 posts

Joined: Jan 1970

did i get this right?
you don't have to build something like a shopping-cart, just one single order-form, yeah?

i would use a 'verification'-form like this:
<input type="hidden"name="price" value="20">20$
<input type="hidden" name="items" value="2">2 items
<input type="hidden" name="total" value="40">total: 40$

<input type="submit" value="order">

it's just the basics here, but if you do it like this you have the opportunity, the costumer can check his data again.
but back to the script, it is not much you need, only thing it has to do is total up the amount, send the mail to the company and store the order in a database.
i'd like to tell you more but could you give me some info first, about how to send the order to the cc-company and what your friend wants to do with the order-data...
cu
patrick

----------
http://www.allcgi.de
not quite up yet, but see if you can find something for you!

They have: 66 posts

Joined: Apr 1999

Here'e an example of exactly what I am looking for.
If anyone can help me out It's be REALLY appreciated!
Smiling

https://orders.karemor.com/secure-bin/orderform.exe

They have: 66 posts

Joined: Apr 1999

Hey thanks for the response guys,

Well what I need is:
1)To total the amount of the purchase
2)the cost of the product(s)
3)plus the applicable taxes and shipping costs

What I need to do is calculate the above and pass it to the commerce engine from the form.

They suggest using a CGI script (or java) that asks customers to choose which product(s) they want and the quantities they wish to buy. Or to hardcode the pricing info so when a customer selects the "buy 1 product button" a predetermined total is charged.

Then they suggest using a shopping cart (which is fine by me). This would obviously calculate subtotal, tax, shipping and total amount. ( I think the shopping cart option is more $)

I hope this explains it a better.

Thanks again
Shpek

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.