View Single Post
  #1  
Old 03-19-2008, 05:22 AM
 
virtual@croatia virtual@croatia is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 92
 

Default Multi currency modul

Important!
This feature is implemented in all new xcart versions and my work on it is discontinued.


Here is a module which brings a multi currency support.
- No limited number of currencies
- It can automatically update the currency rate with only one button pressing
- In combination with IP_Range it can recognize the country where the customer is coming from and choose the right currency for him

http://www.smee.hr/skin1/images/xcart%20forum/client.jpg


Currency management:
http://www.smee.hr/skin1/images/xcart%20forum/admin.jpg

Instrunctions how to install it:

1. Unzip all files in the root of the xcart. Replace all files with the new one (be carefull if you made some changes on admin/func/func.mail.php, skin1/currency.tpl, skin1/modules/Product_Options/check_options.tpl or skin1/modules/Product_Options/func.js)

2. In a browser type http://yoursitedomain/install-currency.php and follow the procedure. You will need a number you were provided with when you were installing the shop for the first time. If you don't have it, you can find it in include/install.php file under $installation_auth_code

3. Insert this code into your design (for example in skin1/head.tpl), where you would like to have a currency choice.
If you want to put it in between a table:
PHP Code:
{if $active_modules.Multi_Currency}
    <
tr><td align="left">{include file="modules/Multi_Currency/menu_currency.tpl"}</td></tr>
    {/if} 


Out of a table:
PHP Code:
{if $active_modules.Multi_Currency}
    {include 
file="modules/Multi_Currency/menu_currency.tpl"}
    {/if} 



4. Insert this code in skin1/admin/menu_admin.tpl, anywhere between lines 3 and 20:
PHP Code:
{if $active_modules.Multi_Currency}<a href="{$catalogs.admin}/currencies.php" class="VertMenuItems">{$lng.lbl_currencies}</a><br />{/if} 


5. Insert this code in skin1/single/home.tpl, anywhere between lines 60 and 250, on any empty line:

PHP Code:
{elseif $main eq "currencies_edit"}
{include 
file="modules/Multi_Currency/currencies.tpl"

After inserting it should look something like this:

PHP Code:
...
{elseif 
$main eq "snapshots"}
{include 
file="admin/main/snapshots.tpl"}

{elseif 
$main eq "currencies_edit"}
{include 
file="modules/Multi_Currency/currencies.tpl"}

{elseif 
$main eq "titles"}
{include 
file="admin/main/titles.tpl"}
... 

6. Insert this code in skin1/admin/home.tpl, anywhere between lines 60 and 250, on any empty line:
PHP Code:
{elseif $main eq "currencies_edit"}
{include 
file="modules/Multi_Currency/currencies.tpl"

After inserting it should look something like this:
PHP Code:
...
{elseif 
$main eq "snapshots"}
{include 
file="admin/main/snapshots.tpl"}

{elseif 
$main eq "currencies_edit"}
{include 
file="modules/Multi_Currency/currencies.tpl"}

{elseif 
$main eq "titles"}
{include 
file="admin/main/titles.tpl"}
... 


7. Insert this code in skin1/admin/menu.tpl:
PHP Code:
{if $active_modules.Multi_Currency}{include file="modules/Multi_Currency/menu_currency.tpl"}<br />{/if} 


8. Do not forget to empty the field of the alternative currency symbol in Admin/General Settings, paragraph General parameters. The default currency should have 3 letters, like CAD or USD or EUR, not US$, € or similar! Don't forget to make some of the currencies active. Go to the currencies section in the admin mode and check Active for the currencies you want to be active.

9. If you use PayPal unpack the file paypal.zip and overwrite your existing files.


Important!
If you want to use it with IP_Range module, you have to install IP_Range module first!
If you miss to do that you have to change line 67 in include/data_cache.php from

PHP Code:
$all_active_modules func_query_column("SELECT module_name FROM $sql_tbl[modules] USE INDEX (active) WHERE active='Y'"); 

to

PHP Code:
$all_active_modules func_query_column("SELECT module_name FROM $sql_tbl[modules] USE INDEX (active) WHERE active='Y' ORDER BY module_name"); 


It's been tested with 4.1.10 and 4.2.1 versions

New version uploaded 23/08/2007 - fixed error "Unknown column 'xcart_currencies.orderby' in 'order clause'"
New version uploaded 02/03/2008 - fixed error with product options prices
New version uploaded 04/03/2008 - fixed minor error with product options prices
New version uploaded 19/03/2008 - implemented gift certificate support
New version uploaded 29/10/2008 - updated for 4.1.10 version
New version uploaded 08/11/2008 - fixed an error when a changing the currency forced the page to be redirected to the main page
Paypal files uploaded 13/01/2009 - if you use PayPal please overwrite your existing files with the one in the attachment

4.2.1 version uploaded 07/06/2009 - this is the first version for xcart 4.2.1. It should work, but if it doesn't please post your problem and I will fix it soon

New versions uploaded 22/06/2009 - Auto update added. It auto sets the rate from the web site http://rss.timegenie.com/forex.txt. After the update the updated currencies will be italic.
New version uploaded 25/06/2009 - minor fix an error during the uninstalling
New version uploaded 25/06/2009 - fix an error for 4.2.1 when SEO option was enabled
New version uploaded 25/06/2009 - fixed some issues with Product Options in 4.2.1
New version uploaded 07/08/2009 - fixed loosing order by after update in version for 4.1.10
Attached Files
File Type: zip x-currency-4.1.10.zip (30.0 KB, 586 views)
File Type: zip paypal.zip (15.5 KB, 582 views)
File Type: zip x-currency-4.2.1.zip (27.0 KB, 621 views)
__________________
Check what you can do with x-cart 4.1.9:
www.smee.com

Modules I made:
IP_Ranges
Multy_Currency
Order_Dates

Modules I use:
Fancycategory
Magnifier
Survey
AOM
Reply With Quote