E-Commerce Currency conversion and Language Switching System
|
Currency Conversion in the Front End
|
|
Linking to Currency Converter
The currency converter is located in shopcurrency.asp, you can link to this page anywhere in your site by adding the following HTML code. <a href="/shopcurrency.asp"><%=getlang("langchangecurrency")%></a>
If you want the currency to be displayed as show with the flag image and chosen currency displayed, you will need to include the following code: <a href="/shopcurrency.asp"><%=getlang("langchangecurrency")%></a> <p align="center"><%showCurrencyFlag%></P> <p align="center"><%=getlang("langchosencurrency")%><BR> <%=GetSess("Fullunitname")%></p>

The currency converter is contained in shopcurrency.asp.
This file will display the countries that have an image for a flag on the main display, and all countries in the currencyvalues table will be shown in the drop down box.
Once a customer clicks which currency they wish to use the prices shown in the shop are automatically changed.
|
|
Setting Up Currency Conversion
|
|
The VPASP currency converter allows customers to display the prices in your shop in a currency that they choose.
How it works
The default currency is configured in the International section of the Online Configuration.
Set the following to your currency. In this example we are using Canadian as the base currency.
xcurrencybase - CAD xcurrencysymbol - CAD$ or just $ xdefaultcountry - CA xlanguage - ENGLISH or French Canadian
Submit the changes by clicking the button at the bottom of the page.
The actual currency conversion values are stored in the currencyvalues table in the database.
Each row in this table represents a different currency.
The currency that has "1"in the conversionvalue field is the default currency and controls the master rate. So if your site is to display in Canadian dollars then you would set Canadian to 1.
You can edit and add currency values to this table by entering your shop administration and going to : Occasional Tasks -> International -> Currency Tables

This page allows you to add a new currency or view and edit the existing currencies. The fields in the currency table are as follows:
| id |
This is automatically generated as the identifier. |
| cid |
The short name for this currency (eg. USD or AUD). |
| fullunitname |
The long name for this currency (eg. US Dollars or Australian Dollars). |
| conversionvalue |
The conversion rate to calculate this currency. Make sure this is 1 for your default currency. |
| currencysymbol |
The symbol for this currency (eg. AU$ or £). |
| theimage |
The path to the image of the flag for this currency. If you supply an image path the image will be displayed in shopcurrency.asp. If you don't display an image it will be included in the drop down list of currencies on shopcurrency.asp |
| hide |
True/False whether this currency should be displayed on your site. |
TIP: You can bulk update your table rates by clicking on the Bulk Update link in the left column. This allows you to update all of your currencies at once.
TIP2: You can import new currencies into the currencyvalues table by going to Everyday Tasks > Advanced > Bulk Import. To see what the table needs to look like you can export the currencyvalues table first as a csv file. X-Rates has an export to Excel feature that allows you to quickly copy and paste the rates into your csv file.
Finding Exchange Rates
You can find currency values wherever you like. We recommend http://www.x-rates.com/. Click on the links to the right to have the default currencies for your site.
|
Languages
|
Using language variables with the Navigation Manager
|
|
This guide will outline how you can create language variables and use them within the navigation manager.
You will first need to create your language variables for each of your different languages.
- Select Occasional Tasks from the top menu
- Edit Language – under the International heading
- Add a record – Top left cornerIn the lang field type the language you are adding the keyword to. For the example below it is English.
- In the Keyword field enter what you wish to call your new language keyword
- In the caption field enter the text you wish to appear.
Do the above 3 steps for each language your store offers. Make sure you keep the Keyword the same.

Once you have completed this for all of your languages choose Site Menu Setup from under the Navigation heading in Occasional tasks.
Now click on the edit option for the menu item you wish to use your new keyword for. In our example this is the home item.
In the menu name field enter the keyword of your word.
Then click submit.

Follow all of the above steps for all of the menu items you wish to dynamically change when switching languages.
create new menu links and also update sub menu links.
|
|
Language Switching
|
|
ASP Online Store can dynamically change the captions used from one language to another. Each language needs two files. The steps necessary to use this facility include: Obtain the languages files from the ASP Online Store site or translate the supplied files
- Load the language into the ASP Online Store languages table
- Turn on Language displays
- Set the current language used in the cart
- Delete a language
You can add the following ASP statement to any ASP page or shoppage_header.htm or shoppage_trailer.htm. This will display a dropdownlist of all available languages. <%NavigateShowLanguage%> %Navigateshowlanguages%>
|
|
Supplied Language Files
|
|
The supplied language files are in English: shop$language_english.asp
shop$language2_english.asp When you purchase ASP Online Store you can request up to four additional languages, or you are free to translate ASP Online Store language files into as many languages as you can. To download language files please visit our web site.
|
|
Installing a New Language
|
|
Assuming you wish to install Spanish as your next language. Download the Spanish files from ASP Online Store. Then go to ASP Online Store administration and go to Occasional Tasks ->Languages -> Add Language
 ASP Online Store knows that there are two language files so there is no need to specify shop$language2_Spanish.asp during this process.
|
|
Reset Language
|
|
The reset language is used to alter the default language being used by all customers. It essentially reloads all the language values from the database and resets the language application variables. This should be used after you have altered the language values using the edit or add facility.
You can do this by going to Occassinal Tasks and selecting from the International drop down "Reset Languages".
Select the language you wish to reset and press continue.
This will force the new language settings into application memory so the site can read them.
|
|
Drop Down List of Languages
|
|
This is used to alter the currently running language in your session. It can be used to quickly test any language changes you have made. |
|
Changing Language Values - Method 1
|
|
Language values can be changed in two ways. You can use your browser by selecting Edit Language from the language administration. The normal ASP Online Store edit display menu is shown. Search for the caption or the language keyword and make the change by editing that caption
 For example to Change the word Tax to State Tax, search for caption Tax and then click edit next to the record.

Once the language has been updated you will need to Reset the language variables by clicking on the Reset Language link and selecting the language to update.
|
|
Alternate method for Changing Values
|
|
The other method is to edit the files shop$language_English.asp and then upload the file to your web hosting company. Select Add a Language. ASP Online Store will update or add records as required. |
|
Using Language Switching
|
|
You can add the following ASP statement to any ASP page or shoppage_header.htm or shoppage_trailer.htm. This will display a dropdownlist of all available languages. <%NavigateShowLanguage%> %Navigateshowlanguages%> |
|
Local Currency
|
|
ASP Online Store can display local currency. This is normally determined by where the web host is located and what their default setting is. To change to a different local currency, locate the following statement ASP Online Store Configuration.
Or you can simply set your own currency symbol.
|
xcurrencysymbol
|
xxxx your own currency symbol
|
Your local currency should now display.
|
|
Dual Currency Display
|
|
ASP Online Store can display both the local currency and any other currency. ASP Online Store dynamically calculates the second currency using a conversion rate you supply. You can alter the way the conversion is done by changing the logic in shopconvertcurrency.asp
|
xdualprice
|
Yes tells ASP Online Store to display dual prices
|
|
xdualconversionrate
|
.800 the number to be multiplied by the price to obtain the dual price
|
|
Xdualpricefield
|
Instead of doing a conversion, the exact dual price can be placed in a field in the products table
|
• Language Changes
In shop$language.asp edit the captions for dual pricing
const LangDualPrice=" Euro Price "
const LangDualTotal=" Euro Total "
|
|
International Currency Conversion
|
|
ASP Online Store can provide a link to a free international currency conversion service http://www.x-rates.com . The service is is an example. It is linked from the minicart display and the following shop configuration values are required.
|
Xcurrencylink
|
Yes
|
|
Xcurrencybase
|
USD The abbreviation for currency required by x-rates-com
|
The xcurrencybase is the abbreviation used by x-rates.com. For your currency abbreviation, please check their site. X-rates.com may at any time change or discontinue, their service and support for changes in ASP Online Store is not guaranteed. It is up to you to determine the usefulness and accurancy of their service. ASP Online Store and X-rates.com have no relationship.
|
|
LCID Language |
|
The Shop Configuration value , xlcid , determines such factors as date format, currency symbol and currency format. LCIDS are supplied by Microsoft and not all may be available on all Window's systems.
1078 Afrikaans 1052 Albanian 5121 Arabic( Algeria ) 15361 Arabic( Bahrain ) 3073 Arabic( Egypt ) 2049 Arabic( Iraq ) 11265 Arabic( Jordan ) 13313 Arabic( Kuwait ) 12289 Arabic( Lebanon ) 4097 Arabic( Libya ) 6145 Arabic( Morocco ) 8193 Arabic( Oman ) 16385 Arabic( Qatar ) 1025 Arabic( Saudi Arabia ) 10241 Arabic( Syria ) 7169 Arabic( Tunisia ) 14337 Arabic(U.A.E.) 9217 Arabic( Yemen ) 1069 Basque 1059 Belarusian 1026 Bulgarian 1027 Catalan 3076 Chinese( Hong Kong ) 2052 Chinese(PRC) 4100 Chinese( Singapore ) 1028 Chinese( Taiwan ) 1050 Croatian 1029 Czech 1030 Danish 2067 Dutch(Belgian) 1043 Dutch(Standard) 9 English 3081 English(Australian) 10249 English( Belize ) 2057 English(British) 4105 English(Canadian) 9225 English(Caribbean) 6153 English( Ireland ) 8201 English( Jamaica ) 5129 English( New Zealand ) 7177 English( South Africa ) 11273 English( Trinidad ) 1033 English( United States ) 1061 Estonian 1080 Faeroese 1065 Farsi 1035 Finnish 2060 French(Belgian) 3084 French(Canadian) 5132 French( Luxembourg ) 1036 French(Standard) 4108 French(Swiss) 2108 Gaelic(Irish) 1084 Gaelic(Scots) 3079 German(Austrian) 5127 German( Liechtenstein ) 4103 German( Luxembourg ) 1031 German(Standard) 2055 German(Swiss) 1032 Greek 1037 Hebrew 1081 Hindi
|
1038 Hungarian 1039 Icelandic 1057 Indonesian 1040 Italian(Standard) 2064 Italian(Swiss) 1041 Japanese1042 Korean 2066 Korean(Johab) 1062 Latvian 1063 Lithuanian 1071 Macedonian 1086 Malaysian 1082 Maltese 1044 Norwegian(Bokmal) 2068 Norwegian(Nynorsk) 1045 Polish 1046 Portuguese(Brazilian) 2070 Portuguese(Standard) 1047 Rhaeto-Romanic 1048 Romanian 2072 Romanian( Moldavia ) 1049 Russian 2073 Russian( Moldavia ) 1083 Sami(Lappish) 3098 Serbian(Cyrillic) 2074 Serbian(Latin) 1051 Slovak 1060 Slovenian 1070 Sorbian 11274 Spanish( Argentina ) 16394 Spanish( Bolivia ) 13322 Spanish( Chile ) 9226 Spanish( Colombia ) 5130 Spanish( Costa Rica ) 7178 Spanish( Dominican Republic ) 12298 Spanish( Ecuador ) 17418 Spanish( El Salvador ) 4106 Spanish( Guatemala ) 18442 Spanish( Honduras ) 2058 Spanish(Mexican) 19466 Spanish( Nicaragua ) 6154 Spanish( Panama ) 15370 Spanish( Paraguay ) 10250 Spanish( Peru ) 20490 Spanish(Puerto Rico) 3082 Spanish( Spain - Modern Sort) 1034 Spanish( Spain - Traditional Sort) 14346 Spanish( Uruguay ) 8202 Spanish( Venezuela ) 1072 Sutu 1053 Swedish 2077 Swedish( Finland ) 1054 Thai 1073 Tsonga 1074 Tswana 1055 Turkish 1058 Ukrainian 1056 Urdu 1075 Venda 1066 Vietnamese 1076 Xhosa 1085 Yiddish 1077 Zulu 2048 default |
|
|
Editing individual translateproduct records
|
|
VPASP has the ability to store different language translations for any product, category or product feature. To enable this functionality, set xtranslate to "Yes" in the shop configuration. This will ensure language translation options appear at the bottom of the normal edit form. These new options display the current translations and provide links to add a new language translation or to edit existing ones.
NOTE: The product, category or product feature you wish to add language translations to, must first exist in the products table. You may then "Edit" the item, and add additional language translations.

Individual translate product records can be changed, added or deleted. The next section describes the translation edit form.
Clicking on Add New Language, brings up a blank form.
Editing Translation Record 
| Language |
A selection of languages currently installed. The default language is not included. |
| Catalogid |
The product catalogid |
| Name |
Product name. (cname in the database) |
| Description |
Product Description (cdescription in the database) |
| More |
Extended description (extendeddesc in the database) |
Navigation At the top of the form there are two hyperlinks
Select Table translateproducts | Main Record
| Select Table translateproducts |
Returns to normal edit/display of the translateproducts table |
| Main Record |
Brings you back to the main product record. |
|
Translating Products and Categories
|
Translation Package
|
|
The ASP Online Store translation facility allows you to dynamically switch major fields in the products, categories and product features a table depending upon what language the customer selects.
For example of the customer selects German, then the product description, product name and product extended description will all change with the language. The feature captions and values will also change into German.
The translation facility works both with template formatting and with normal ASP Online Store formatting. The ASP Online Store translation package provides enhanced features and facilities.
* Dynamic switch for product name, description and extended description * Dynamic switch for category description * Dynamic switch of product feature captions and values * Dynamic switch of hyperlinks generated on category and product displays * Works with and without templates * Work with dynamic header facility of ASP Online Store * Shows product dependent product name on facilities such as tell a friend, reviews, ask a question and other ASP Online Store product displays. * Requires that you enter the values to be show for product and category into new tables. * There is no limit to number of languages supported * If a translated field does not exist, the default language value is displayed * Three additional tables are now used: translateproducts to hold the translation for products and translatecategories for categories and translateprodfeatures to hold product features. * Allows products and categories to be displayed in any language while keep a single stock control record.
|
|
Adding your language values
|
|
This section assumes that you have already added additional languages and are using them to change the captions in your shop. Now you may wish to use the ASP Online Store translation facility to dynamically change product details such as description, name and extended description based on the language chosen, and want to display category names based on the language chosen by your customer. ASP Online Store provides a number of methods of updating the translation tables, translateproducts and translate categories. The methods include:
1. When editing a product, a new button is provided to let you add and update existing translation 2. When editing a category a new button is provided to add and update an existing translation. 3. When editing a product feature new buttons are displayed to let you add and update a translation. 4. It is possible to use the bulk Import routine, to load the new translation tables. 5. Using the standard ASP Online Store edit/display facilities. This allows you to add and delete records as per any standard ASP Online Store table.
|
|
Advanced Extensions
|
|
You may wish to extend this facility to other fields with in the products table. For example you may wish to translate the pother5 field. This can be supported in templates in the form
[translate pother]
To make this work, you must also add the field pother5 to the translateproducts table. The standard shopa_edittranslateproducts.asp file will not automatically know about this new field but the raw ASP Online Store editor shopa_editrecord.asp will pick up the new field.
The new field will NOT be translated outside of templates.
|
|
Restrictions
|
|
Once an item is added to the cart in a specific language, it will remain in that language throughout the ordering process. This includes emails to both customers and merchants.
Only specific fields are dynamically translated. These are
| Cname, cdescription, extendeddesc |
For Products |
| Catdescription |
For categories |
| Featurename and featurecaption |
For product features |
|
|
Changing Category Template
|
|
If you plane to use templates and the translation facility, then you need to edit your templates such as tmp_categorytemplate.htm change a few lines.
| [catdescription] |
[translate catdescription] |
|
|
Changing Product Templates
|
|
If you plane to use templates and the translation facility, then you need to edit your templates such as tmp_product.htm and tmp_productformat.htm and change a few lines.
In the templates you may have control statements such as: for products.
| [cname] |
[translate cname] |
| [cdescription] |
[translate cdescription] |
| [extendeddesc] |
[translate extendeddesc] |
|
|
Bulk Updating
|
|
The translation tables, translateproducts, translatecategories and translateprodfeatures can be be bulk updated just like any other ASP Online Store table. The field names are shown below. All field names are in lower case in the database.
Translateproducts table.
| Translateid |
Unique Id |
| Lang |
Language name |
| Catlogid |
Product catalogid. Links back to main product record |
| Cname |
Translated Product name |
| Cdescription |
Translated product description |
| Extendeddesc |
Translated extended description |
Translatecategories table.
| Translateid |
Unique Id |
| Lang |
Language name |
| Categoryid |
Category number. Links back to categories table |
| Catdescription |
Translated category description |
Translateproductfeatures table.
| Translateid |
Unique Id |
| Lang |
Language name |
| Id |
Feature id links back to prod features table |
| Featurecaption |
Translated feature caption |
| Featurename |
Translated feature name |
|
(Back to E-Commerce Online Store Features)
|
|