Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Little help with ASP, please
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  07:57:49  Show Profile  Visit sji2671's Homepage
A bit cheeky, but I have tried other resources with no luck and feel this is the best place to find someone who knows ASP.

I have a shopping cart (midicart), problem is we sell in £, and the merchant needs the amount in dollars. I'm willing to update a figure, usually our total * 1.50 but have tried in vain to implement it.

The line that sends the info across to the merchant is :
<input type="text" name="total" size="10" VALUE="<% = Request.form("total") %>">

I changed this to :
<input type="text" name="total" size="10" VALUE="<% = Request.form("total")*1.50 %>">

Hoping our total would be multiplied by 1.5 and given to the merchant, which it does but doesnt include a decimal place, ie £14.50 suddenly becomes $2175, I tried *0.015 but that didnt change the result. there must be a simple way to do it, but I'm stumped.

Any help would be more than appreciated.
Our shop is at :
http://www.xpress-gifts.co.uk/shop
The page that transfers info to the merchant is :
http://www.xpress-gifts.co.uk/shop/order_transfer.asp


Moved from Help/Current Version

Edited by - Nathan on 28 March 2002 15:06:59

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 28 March 2002 :  09:31:09  Show Profile  Visit HuwR's Homepage
ok, I would do it this way

(CCur(Request.form("total"))*3)/2

Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  09:39:01  Show Profile  Visit sji2671's Homepage
<input type="text" name="total" size="10" VALUE="<% = (CCur(Request.form("total"))*3)/2
%>">

Is this the line that I should change it too then ?

Thanks I'll give it a go

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 28 March 2002 :  09:53:33  Show Profile  Visit HuwR's Homepage
yes, or use CDbl instead of CCur, the key is changing the Request.form("total") which is a string, into a number.

Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  13:12:44  Show Profile  Visit sji2671's Homepage
no joy i'm afraid.

£5.44 in the shopping cart ends up as $816 , tried CDbl as well.

Maybe this isnt as simple as I thought it was gonna be..

Go to Top of Page

Aaron S.
Average Member

USA
985 Posts

Posted - 28 March 2002 :  13:22:37  Show Profile  Visit Aaron S.'s Homepage
What about:

<%= cint(Request.form("total"))*1.50 %>">




Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  14:02:28  Show Profile  Visit sji2671's Homepage
driving me insane, lol.

Still no decimal point, changes the figure from £7.44 to $1116 .



Go to Top of Page

em_
Starting Member

23 Posts

Posted - 28 March 2002 :  16:36:18  Show Profile
ASP can't multiply by a % AFAIK.

I would try this:

<%
dim amt

amt = CDbl(Request.form("total")) * 1.5
%>

<input type="text" name="total" size="10" VALUE="<%=amt%>">



Do the multiplication outside of the the printing.

If you want to round up the numbers to two digits use:


<input type="text" name="total" size="10" VALUE="<%=FormatNumber(amt,2)%>">





Edited by - em_ on 28 March 2002 16:39:13

Edited by - em_ on 28 March 2002 16:43:16
Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  16:44:59  Show Profile  Visit sji2671's Homepage
thanks, just tried that coding.

Same result the cart came to £7.44 but when swopping to the merchant the price was $1116

<pulls hair out>

Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  16:54:06  Show Profile  Visit sji2671's Homepage
I have uploaded a text version of the file
http://www.xpress-gifts.co.uk/shop/order_transfer.txt

With the last attempt.

Anyone with more knowledge than I and time to kill, please help!

Thanks
Scott

Go to Top of Page

em_
Starting Member

23 Posts

Posted - 28 March 2002 :  17:10:53  Show Profile
Are you sure you're not multiplying by something before that? This makes no sense otherwise. Are you trying some kind of currency conversion?

Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  17:19:16  Show Profile  Visit sji2671's Homepage
It is a crude currency conversion, were in the UK. Our merchant that will process the credit cards is US and only accepts $ figures.

Therefore we need to transfer our total to dollars and send it to them via the <form>.

Its an ASP shopping cart midicart.com

The link was just the page that changes from our cart to the merchant, before that page all the shipping details etc are taken.





Go to Top of Page

em_
Starting Member

23 Posts

Posted - 28 March 2002 :  17:42:14  Show Profile
Can you link up your form to just to a response.write instead of submitting the data so we can see whats going on?

Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  17:48:09  Show Profile  Visit sji2671's Homepage
lost me, how would I do that, u mean change the link of the form to ?



Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 28 March 2002 :  17:51:04  Show Profile
can you post the code from the page with the form that sends the total value to the page you're having problems with?

Nikkol
Go to Top of Page

sji2671
Junior Member

United Kingdom
185 Posts

Posted - 28 March 2002 :  17:55:10  Show Profile  Visit sji2671's Homepage
All the pages up to order_transfer.asp work fine.
The order_transfer.asp page collects info from previous pages, ie items , info and sends it to the merchant 2checkout.com, getting the figure we collect in uk sterling and somehow changing it at order_transfer.asp into dollars so that the merchant gets a dollars figure is the problem

the previous page to order_transfer.asp is :
http://www.xpress-gifts.co.uk/shop/order_card.asp

These pages are used inside a frame.

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07