HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 8th, 2004, 03:00 AM
mspaul mspaul is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 23 mspaul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 20 sec
Reputation Power: 0
Total price in Other Currency (Real time rate)

Hi guys,


This may prove to be a real challenge, (well for me anyway )...
I've just launched a web site that sells collectibles. To do this I've got a ASP shopping cart with a checkout process.
As all the prices on my site are in Australian Dollars, I' trying my very best to find a way to display the total price in USD as well....

Eg:
Total Price : $ AUD 100.00
Total Price : $ USD 79.00 (real time rates)

I need to do this because I also want to Accept PAYPAL account payments which cannot be made in AUD.

Please help guys,

Reply With Quote
  #2  
Old September 8th, 2004, 07:32 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Hi

There are various sites (OandA etc.) who provide XML feeds but this is not cheap

MK

Reply With Quote
  #3  
Old September 8th, 2004, 07:40 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
If a few people want this, I might consider sorting out an OandA (or similar) account and provide a simple means to collect exchange information from my site (for a small fee of course!)

MK

Reply With Quote
  #4  
Old September 8th, 2004, 08:11 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Ok - I've found a free feed. I've not checked whether the exchange rate is correct, but this script should work (also attached for better code formatting):
Code:
<%
' Parameters
GBL_URL = "http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=#From#&ToCurrency=#To#"
GBL_FROM = "AUD"
GBL_TO = "USD"
%>
<%
' Strip HTML tags from a string
Function RemoveHTML( str_HTMLString )
Dim RegExp
Set RegExp = New RegExp
RegExp.Pattern = "<[^>]*>"
RegExp.Global = True
str_HTMLString = Replace(LCase(str_HTMLString), "<br>", chr(10))
RemoveHTML = RegExp.Replace(str_HTMLString, "")
End Function
' Collect a remote URL response
Function GetURL( str_URL )
Set obj_XMLHTTP = Server.CreateObject ("Microsoft.XMLHTTP") 
obj_XMLHTTP.Open "GET", str_URL, False, "", "" 
obj_XMLHTTP.Send()
If Err.Number = 0 Then
If obj_XMLHTTP.Status = 200 Then
GetURL = obj_XMLHTTP.ResponseText
Else
GetURL = "*Error*"
End If
Else
GetURL = "*Error*"
End If 
Set obj_XMLHTTP = Nothing 
End Function
' Cleanup extraneous characters
Function Cleanup( str_String )
str_String = Replace(str_String,vbcrlf,"")
str_String = Replace(str_String,vbcr,"")
str_String = Replace(str_String,vblf,"")
Cleanup = str_String
End Function
%>
<%
' Use query string?
If Len(Request.QueryString("From")) = 3 Then GBL_FROM = UCase(Request.QueryString("From"))
If Len(Request.QueryString("To")) = 3 Then GBL_TO = UCase(Request.QueryString("To"))
' Format GET string
GBL_URL = Replace(GBL_URL,"#From#",GBL_FROM)
GBL_URL = Replace(GBL_URL,"#To#",GBL_TO)
' Get the URL and cleanup HTML tags and extraneous line feeds
str_GetURL = Cleanup(RemoveHTML(GetURL(GBL_URL)))
%>
1 <%= GBL_FROM %> = <%= str_GetURL %>&nbsp;<%= GBL_TO %>
MK
Attached Files
File Type: zip fx.zip (819 Bytes, 208 views)

Reply With Quote
  #5  
Old September 9th, 2004, 06:02 PM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
No - no need to thank me!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Total price in Other Currency (Real time rate)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway