Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Multi currency modul

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #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, 809 views)
File Type: zip paypal.zip (15.5 KB, 803 views)
File Type: zip x-currency-4.2.1.zip (27.0 KB, 844 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

The following user thanks virtual@croatia for this useful post:
arekjenggolo (09-03-2011)
  #2  
Old 03-20-2008, 11:53 PM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Multi currency modul

Hi

Is this version OK to install on a 4.1.8 store?
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #3  
Old 03-21-2008, 02:42 AM
 
virtual@croatia virtual@croatia is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 92
 

Default Re: Multi currency modul

Quote:
Originally Posted by 01bodyjewellery
Is this version OK to install on a 4.1.8 store?

Yes, it is. It's been tested from 4.1.6 to 4.1.9 versions.
__________________
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
  #4  
Old 03-26-2008, 07:29 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Multi currency modul

For some reason after I install this mod there are no fields showing in the section where you define the exchange rates. All of the countries and areas are these just no boxes in which to enter anything.

Any ideas what this might be or how to fix it?
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #5  
Old 04-02-2008, 01:43 AM
 
virtual@croatia virtual@croatia is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 92
 

Default Re: Multi currency modul

Quote:
Originally Posted by 01bodyjewellery
For some reason after I install this mod there are no fields showing in the section where you define the exchange rates. All of the countries and areas are these just no boxes in which to enter anything.

Any ideas what this might be or how to fix it?


It seams that some xcart versions have the tables xcart_currencies and xcart_country_currencies empty. In that case you should download the last full version of the xcart, decompress it, open the file xcart_data.sql which is in the folder sql and copy everything between lines:

INSERT INTO xcart_country_currencies VALUES ('ADP','AD');

and

INSERT INTO xcart_currencies VALUES ('ZWD',716,'Zimbabwe Dollar','$');



Paste it in php MyAdmin and execute it. This will fill the tables with all world currencies.
__________________
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
  #6  
Old 04-04-2008, 11:15 AM
 
POSDepot POSDepot is offline
 

Advanced Member
  
Join Date: Sep 2002
Posts: 52
 

Default Re: Multi currency modul

Thanks very much for this.

This is working like a charm except I don't know how to get the currency symbol to be in front of the price on product pages.
I edited the skin1/currency.tpl to get the other areas of the site to reverse these fields but the product page doesn't use this tpl I guess.

Everything else works great.
Thanks again.

Randy
__________________
X-Cart Gold
4.1.9
Reply With Quote
  #7  
Old 04-05-2008, 01:18 AM
 
virtual@croatia virtual@croatia is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 92
 

Default Re: Multi currency modul

Quote:
Originally Posted by POSDepot
Thanks very much for this.

This is working like a charm except I don't know how to get the currency symbol to be in front of the price on product pages.
I edited the skin1/currency.tpl to get the other areas of the site to reverse these fields but the product page doesn't use this tpl I guess.

Randy

You were on the right way. Open the file skin1/currency.tpl and find the line

{$value|abs_value|formatprice}&nbsp;{$shop_currenc y.symbol}

which is in use when module is activated. If you want to have the currency symbol in front of the price just change it to:

{$shop_currency.symbol}{$value|abs_value|formatpri ce}

(For some reason, this forum is presenting this two lines with a space in between text. Please, delete the space when you copy/paste the text.)

Regards,
virtual@croatia
__________________
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
  #8  
Old 04-05-2008, 06:44 AM
 
CanadaPOS CanadaPOS is offline
 

Member
  
Join Date: Nov 2007
Posts: 12
 

Default Re: Multi currency modul

Actually that is the edit I made but it is not working on the product page, but I think I know why: all my products have options. If I add a product with no options then it works fine, but with options it still shows the currency symbol after the price.

Regards,
Randy
__________________
X-cart 4.1.9
Reply With Quote
  #9  
Old 04-05-2008, 08:57 AM
 
virtual@croatia virtual@croatia is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 92
 

Default Re: Multi currency modul

Quote:
Originally Posted by CanadaPOS
...all my products have options. If I add a product with no options then it works fine, but with options it still shows the currency symbol after the price.

OK, now I know where the problem is. Open skin1/modules/Product_Options/func.js, find:

Code:
document.getElementById('product_price').innerHTML = price_format(price < 0 ? 0 : price)+' '+currency_symbol;

and change it to:

Code:
document.getElementById('product_price').innerHTML = currency_symbol+price_format(price < 0 ? 0 : price);

Regards,
virtual@croatia
__________________
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
  #10  
Old 04-10-2008, 07:58 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Multi currency modul

I am still seeing no boxes to fill out on the currency lists.

I have followed your instructions about posting the SQL into phpMyadmin and it now says there are
Rows 210
Row length 6
Row size 26 B

Any ideas what else i could try?
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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
Forum Jump


All times are GMT -8. The time now is 10:08 AM.

   

 
X-Cart forums © 2001-2020