|iisCART2000 EX OBJECT - PROPERTIES (requires
Exchange and Currency Select Display
allow your store visitors to view prices in their own currency. The
actual bill amount and totals will not be modified.
iisCARTex supports over 170 currencies and precious metals.
usage in Setcurrency.asp
This simple example sets the carts currency
value. Once this is complete, displaycart will display values in the
selected currency relative to the base currency. This is for display
purposes only and the actual values and billing would occur in the native
currency for your store. Once you have set the currency you can view
displaycart.asp in the same session and see the converted values.
Set Cart = Server.CreateObject("iiscart2000.store")
tocurrency = request.form("tocurrency")
if tocurrency <> "" then
cart.ex.currency = tocurrency
<form method='post' action='Currency.asp'>
Response.write cart.ex.List("tocurrency",tocurrency) & "<BR>"
<input type='submit' value='Set currency'>
Session("Cart") = Cart.SaveCart
Set Cart = Nothing
and Properties (accessed through the ex object. e.g. cart.ex.x)
- Convert - Converts the amount provided to the
currency specified or uses the base currency if not specified. result
= cur.convert(amount, currency, optional decimal places, optional base
- CurrencyToCode - Converts a currency name to the
- CodeToCurrency - Converts a currency code to the
- List - Returns an HTML combo box with all
currency types and the base currency selected. Optional
parameters include the combobox name and default selected value
- Rate - Returns the rate for a given currency code
relative to the base currency.
- Update - Updates the local database with current
rates from the web. This operation can take 10 - 60 seconds and
typically would be run once a day. This method returns 1 on
success and populates the error property if it fails.
- Adjust - Adjusts the return of convert +/- a
percentage or fixed amount
cur.adjust = "%2" or cur.adjust = "2" or
cur.adjust = "%-2"
- Base - Sets the base currency. This
determines which currency is selected by default in the list method
and also which currency values are fetched by the update method and
stored in the database. For example if USD was specified all
other currencies would display rates relative to USD.
cur.base = "USD"
- Currency - The code you wish to display results
- Error - Error messages are set in the error
- LastUpdate - Returns the last date and time the
update method was run. This can be used to automate running
update every 1 day, 12 hours etc.
- Timeout - in seconds that the component will wait
for the return when running the update method
cur.timeout = 45