X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Multi currency modul (https://forum.x-cart.com/showthread.php?t=38421)

virtual@croatia 03-19-2008 05:22 AM

Multi currency modul
 
16 Attachment(s)
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

Freakmode 03-20-2008 11:53 PM

Re: Multi currency modul
 
Hi

Is this version OK to install on a 4.1.8 store?

virtual@croatia 03-21-2008 02:42 AM

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.

Freakmode 03-26-2008 07:29 AM

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?

virtual@croatia 04-02-2008 01:43 AM

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.

POSDepot 04-04-2008 11:15 AM

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

virtual@croatia 04-05-2008 01:18 AM

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

CanadaPOS 04-05-2008 06:44 AM

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

virtual@croatia 04-05-2008 08:57 AM

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

Freakmode 04-10-2008 07:58 AM

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?

virtual@croatia 04-10-2008 08:17 AM

Re: Multi currency modul
 
Quote:

Originally Posted by 01bodyjewellery
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?


Can you send me the master password on admin@smee.hr and I'll check it today?

Freakmode 04-15-2008 11:46 AM

Re: Multi currency modul
 
Sorry for the delay - been away

Have sent over the details now, thanks for taking a look at this for us.

virtual@croatia 04-15-2008 11:09 PM

Re: Multi currency modul
 
Quote:

Originally Posted by 01bodyjewellery
I am still seeing no boxes to fill out on the currency lists.



We have fixed the problem. The problem was that, during the first installation, the tables xcart_currencies and xcart_country_currencies were empty and the module couldn't retract the data from them, required for the third table which is the part of the module. If someone else will have the same problem, fill the tables as I explained below and reinstall the module after that:

Quote:

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.

deadzebrainc 04-16-2008 12:40 PM

Re: Multi currency modul
 
Does anyone here have the programming chops (and time/energy/goodwill) to look into updating the currency data with daily exchange rates posted (for free) by the Federal Reserve at:
http://www.federalreserve.gov/releases/h10/Update/

It would be great if someone knew how to set up some sort of cron job or script that ran once daily to import the Federal Reserve data, parse it and update the x-cart currency SQL, turning this mod into a free near-real-time currency converter.

With the dollar doing its thing lately I am more and more concerned with easy international order accessibility, this would be a great thing!

Freakmode 04-16-2008 10:55 PM

Re: Multi currency modul
 
Big thanks to Hrvoje for all his help in getting this and the GeoIP mod working on our store.
Immediate overnight benefit with many orders from the USA.

Great mod, really nice guy..

virtual@croatia 04-16-2008 11:38 PM

Re: Multi currency modul
 
Quote:

Originally Posted by deadzebrainc
Does anyone here have the programming chops (and time/energy/goodwill) to look into updating the currency data with daily exchange rates posted (for free) by the Federal Reserve at:
http://www.federalreserve.gov/releases/h10/Update/

It would be great if someone knew how to set up some sort of cron job or script that ran once daily to import the Federal Reserve data, parse it and update the x-cart currency SQL, turning this mod into a free near-real-time currency converter.


I've checked the pages. I was working on lot of parsers and the problem is that when they change the pages the whole job must to be redone again, completely from the beginning. If you find any xml pages for free with the same data I will do that. In the mean time, you'll have to do that manually.

Regards,
virtual@croatia

Italian Glassman 05-03-2008 07:34 AM

Re: Multi currency modul
 
Just a quick question:
I deal with two main currencies (USD & CAD).

If my Canadian clients click on CAD, will their account be credited in CAD by PayPal?
Conversely, if my US clients click on USD, will their account be credited in USD by PayPal?

My site is currently only in USD and although I show the CAD conversion on the site, my Canadian clients still get charged in USD and some of them are annoyed by this (and some others have written to tell me that they won't buy from me until they can purchase in CAD).

Thanks for letting me know if your mod does this. If not, perhaps you can point me to something that could do the job. Thanks!!!

Mario

virtual@croatia 05-04-2008 11:11 AM

Re: Multi currency modul
 
Quote:

Originally Posted by Italian Glassman
Just a quick question:
I deal with two main currencies (USD & CAD).

If my Canadian clients click on CAD, will their account be credited in CAD by PayPal?
Conversely, if my US clients click on USD, will their account be credited in USD by PayPal?

My site is currently only in USD and although I show the CAD conversion on the site, my Canadian clients still get charged in USD and some of them are annoyed by this (and some others have written to tell me that they won't buy from me until they can purchase in CAD).

Thanks for letting me know if your mod does this. If not, perhaps you can point me to something that could do the job. Thanks!!!

Mario


This module won't help you to solve it. In the next 30 days I'm planning to include pay pal system into my web site and after that I'll know is it possible or not to do that. Could you please remind me on it 30 days from now?

virtual@croatia

Italian Glassman 05-04-2008 04:54 PM

Re: Multi currency modul
 
Will do. Thanks for your help!
Mario

konadnailart 05-07-2008 11:37 AM

Re: Multi currency modul
 
Hi
I got the following error when trying to install, any pointers. Am using 4.1.9.
Thanks


Copying skin files ...

Copying to file skin1\modules/Multi_Currency\currencies.tpl - [OK]
Copying to file skin1\modules/Multi_Currency\menu_currency.tpl - [OK]
[OK]

Activating the module ...

Please wait ...
[OK]

Please wait ...
Creating table: [xcart_currency_rate] ... [OK]
[FAILED] You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT value FROM xcart_config WHERE name = 'currency_symbol')

virtual@croatia 05-18-2008 08:25 AM

Re: Multi currency modul
 
Quote:

Originally Posted by konadnailart
Hi
I got the following error when trying to install, any pointers. Am using 4.1.9.
Thanks


Copying skin files ...

Copying to file skin1\modules/Multi_Currency\currencies.tpl - [OK]
Copying to file skin1\modules/Multi_Currency\menu_currency.tpl - [OK]
[OK]

Activating the module ...

Please wait ...
[OK]

Please wait ...
Creating table: [xcart_currency_rate] ... [OK]
[FAILED] You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT value FROM xcart_config WHERE name = 'currency_symbol')


Hi,

I didn't get any email for this thread that's why I didn't respond earlier.
Try to manually execute the SQL code to see what kind of error do you get. Open the php MyAdmin for your database (you should've got it from your web provider) and execute the following:

UPDATE xcart_currency_rate SET active = 'Y' WHERE code = (SELECT value FROM xcart_config WHERE name = 'currency_symbol') OR code = (SELECT xcart_currencies.code FROM xcart_currencies INNER JOIN xcart_config ON xcart_currencies.symbol = xcart_config.value AND xcart_config.name = 'currency_symbol');

CREATE TABLE xcart_customer_currency (
login VARCHAR ( 32 ) NOT NULL DEFAULT '',
currency CHAR( 3 ) NOT NULL DEFAULT '',
PRIMARY KEY (login)
) TYPE=MyISAM;

Send me a post if you get any errror.

virtual

virtual@croatia 05-18-2008 08:33 AM

Re: Multi currency modul
 
Quote:

Originally Posted by Italian Glassman
Just a quick question:
I deal with two main currencies (USD & CAD).

If my Canadian clients click on CAD, will their account be credited in CAD by PayPal?
Conversely, if my US clients click on USD, will their account be credited in USD by PayPal?

My site is currently only in USD and although I show the CAD conversion on the site, my Canadian clients still get charged in USD and some of them are annoyed by this (and some others have written to tell me that they won't buy from me until they can purchase in CAD).

Thanks for letting me know if your mod does this. If not, perhaps you can point me to something that could do the job. Thanks!!!

Mario


I've begun the work on the PayPal and gess what, it doesn't support non us or non uk businesses :evil:. So it will take a time untill I find a solution for it. And after I find I will work on it.
It won't be a problem to implement the multi currency in the paypal, but you have to be aware that PayPal charges you 2,5% for conversion, so it might be lot cheaper for your customers to pay in USD than to pay in CAD and than to you pay 2,5% for conversion in USD.

Can I ask you, how were you able to open an account on the US PayPal when you are from Canada?

virtual

Italian Glassman 06-02-2008 04:57 AM

Re: Multi currency modul
 
Sorry for the long reply Virtual, this post must have sneaked by me.
Paypal allows you to use it if you are from Canada but only the Paypal Standard -- we cannot use the Paypal Pro.

Thanks for the heads up on the currency conversion costs. I think that I can work with that (will have to adjust prices somewhat) but I think that the optics would still be best if I can provide the items in CAD as well as USD.

I appreciate you working on this and look forward to hearing what you can do.

Thanks again!
Mario

virtual@croatia 06-03-2008 01:01 AM

Re: Multi currency modul
 
Quote:

Originally Posted by Italian Glassman
Sorry for the long reply Virtual, this post must have sneaked by me.
Paypal allows you to use it if you are from Canada but only the Paypal Standard -- we cannot use the Paypal Pro.

Thanks for the heads up on the currency conversion costs. I think that I can work with that (will have to adjust prices somewhat) but I think that the optics would still be best if I can provide the items in CAD as well as USD.

I appreciate you working on this and look forward to hearing what you can do.

Thanks again!
Mario


We are opening a branch in the UK to get the option of using the PayPal Pro. It will take a while to open it and after that I will check how to implement the module with it.

virtual

tqualizerman 07-23-2008 07:10 PM

Re: Multi currency modul
 
I'm trying to install this on 4.1.10 but am getting an error:

Copying skin files ...

Copying to file skin1/modules/Multi_Currency/menu_currency.tpl - [OK]
Copying to file skin1/modules/Multi_Currency/currencies.tpl - [OK]
[OK]

Activating the module ...

Please wait ...
[OK]

Please wait ...
[FAILED] Column count doesn't match value count at row 1

Can anyone help?

pairodimes 07-24-2008 09:49 AM

Re: Multi currency modul
 
Thanks you for posting this mod - I have a question about the compatibility of this mod with One Page Checkout by Altered Cart.

I have a need for Managing currencies and showing the price based on IP location - so I really hope this works :)

PS - do we need to download another mod for the IP location stuff?

P.P.S - is there anyway to manage more than 2 currencies with the out of the box distribution of xcart 4.1.9? - so far I can only show 2. Euro and USD.

AquaClic 08-05-2008 12:08 AM

Re: Multi currency modul
 
Quote:

Originally Posted by tqualizerman
I'm trying to install this on 4.1.10 but am getting an error:

Copying skin files ...

Copying to file skin1/modules/Multi_Currency/menu_currency.tpl - [OK]
Copying to file skin1/modules/Multi_Currency/currencies.tpl - [OK]
[OK]

Activating the module ...

Please wait ...
[OK]

Please wait ...
[FAILED] Column count doesn't match value count at row 1

Can anyone help?


same here... have you found a solution to this yet or at least a hint where i can search :mrgreen:

tqualizerman 08-05-2008 01:31 AM

Re: Multi currency modul
 
Quote:

Originally Posted by AquaClic
same here... have you found a solution to this yet or at least a hint where i can search :mrgreen:


The author is willing to work on the solution, but needs access to a site running 4.1.10 and phpMyAdmin, but I can't help on my setup.

virtual@croatia 08-07-2008 01:03 AM

Re: Multi currency modul
 
Quote:

Originally Posted by AquaClic
same here... have you found a solution to this yet or at least a hint where i can search :mrgreen:


I'm at the vacation right now and have limited access to the internet.

Seems to me that the problem is with the version 4.1.10 and with the changed table xcart_config in it. It looks that there is a column added at the end for some other purpose which produces the error. I tried to add an empty string at the end of the query and have sent it to tqualizerman but he said that the problem still exists.

If you are willing to search for it, there is a file x-currency.sql in folder sql which has to be corrected. If you won't be able to fix it, I'll do it for you when I come home (2 weeks).

Regards,
virtual

virtual@croatia 08-07-2008 01:09 AM

Re: Multi currency modul
 
Quote:

Originally Posted by pairodimes
Thanks you for posting this mod - I have a question about the compatibility of this mod with One Page Checkout by Altered Cart.



I don't know, never tried. I'm not at home right now so I won't be able to help you if there is a problem with it. Better try it locally first and if it works do it on line.

Quote:

Originally Posted by pairodimes
I have a need for Managing currencies and showing the price based on IP location - so I really hope this works :)



It does, you can check it on my web site www.smee.hr.

Quote:

Originally Posted by pairodimes
PS - do we need to download another mod for the IP location stuff?



Yes, and YOU HAVE TO INSTALL IT FIRST! IP range module and then Multicurrency module or you will have to change a line in a file as it is explained in the first post.

Quote:

Originally Posted by pairodimes
P.P.S - is there anyway to manage more than 2 currencies with the out of the box distribution of xcart 4.1.9? - so far I can only show 2. Euro and USD.


No, it's not.

Waynarky 08-20-2008 07:03 AM

Re: Multi currency modul
 
Hi guys

This mod is exactly what I need. I'm using 4.1.9. (my signature says 4.1.10, but the site I'm currently working on is 4.1.9)
Does it work on this version?

Your signature is a bit disconcerting Virtual! LOL:
Quote:

Check what you can do with x-cart 4.1.9:

I have limited knowledge of PHP so would need assistance fixing any bugs.

Much appreciated :D/

virtual@croatia 08-20-2008 08:27 AM

Re: Multi currency modul
 
Quote:

Originally Posted by Waynarky
Hi guys

This mod is exactly what I need. I'm using 4.1.9. (my signature says 4.1.10, but the site I'm currently working on is 4.1.9)
Does it work on this version?



I think it should work with it. I can help you with it if it won't work.

Waynarky 08-21-2008 11:40 PM

Re: Multi currency modul
 
Many Thanks!! I'll implement it and let you know either way.

Waynarky 08-29-2008 02:01 AM

Re: Multi currency modul
 
Hi Virtual

I've implemented the module and its working great. Thank you very much!
The instructions were clear and simple :)

I do want to ask about one small issue though. When I change currency it goes back to the home page, instead of refreshing the product page. I see that on your www.smee.hr site, that's not the case. Can you help?

Freakmode 08-29-2008 11:56 PM

Re: Multi currency modul
 
Yep - I would also like to know how to keep the user on the current page after a currency change - thanks

AquaClic 09-25-2008 03:41 AM

Re: Multi currency modul
 
Quote:

Originally Posted by virtual@croatia
If you are willing to search for it, there is a file x-currency.sql in folder sql which has to be corrected. If you won't be able to fix it, I'll do it for you when I come home (2 weeks).

Regards,
virtual


Hi there

I tried to fix it myself but i didn't have any success. I always get the same sql error. I also have to admit that my sql-knowledge isn't very good either :mrgreen:.

Is there anything else i should try?

thanks for your time

Aqua

AquaClic 10-12-2008 03:11 PM

Re: Multi currency modul
 
Okay, i figured that one out, just add an empty string at the end of row 1 and it will install but the menu-point "currencies" won't appear in the backend and i get this if i try to reinstall the module

Code:

Copying skin files ...

Creating directory: [skin1/modules/Multi_Currency] ... [OK]
Copying to file skin1/modules/Multi_Currency/menu_currency.tpl - [OK]
Copying to file skin1/modules/Multi_Currency/currencies.tpl - [OK]
[OK]

Activating the module ...

Please wait ...
[OK]

Please wait ...
Creating table: [xcart_currency_rate] ... [OK]
Creating table: [xcart_customer_currency] ... [OK]
[OK]

Please wait ...
[FAILED] Duplicate entry 'US-lbl_default_currency' for key 1


tqualizerman 10-12-2008 04:21 PM

Re: Multi currency modul
 
Quote:

Originally Posted by AquaClic
Okay, i figured that one out, just add an empty string at the end of row 1 and it will install but the menu-point "currencies" won't appear in the backend and i get this if i try to reinstall the module

Code:

Copying skin files ...

Creating directory: [skin1/modules/Multi_Currency] ... [OK]
Copying to file skin1/modules/Multi_Currency/menu_currency.tpl - [OK]
Copying to file skin1/modules/Multi_Currency/currencies.tpl - [OK]
[OK]

Activating the module ...

Please wait ...
[OK]

Please wait ...
Creating table: [xcart_currency_rate] ... [OK]
Creating table: [xcart_customer_currency] ... [OK]
[OK]

Please wait ...
[FAILED] Duplicate entry 'US-lbl_default_currency' for key 1



I hope we can get this module working for 4.1.10. Is the author around anymore?

AquaClic 10-16-2008 07:05 AM

Re: Multi currency modul
 
Okay, i figured this one out

It actually was an empty string missing in the x-currency.sql in the sql folder. I didn't try this because Virtual stated in a post before that it didn't work.

BEWARE
I'm posting this only to find out what the problem is. The problem is following and i'm still working on it, maybe someone can help me out:

I installed the module and it's working correctly on 4.1.10 but i get the error 2 posts above if i try to reinstall/uninstall the module.

I don't know what will happen with other 4.1.10 installations and i'm not sure if it is good for anyone to install it this way untill we've found a proper solution(!).

This is how my x-currency.sql in the sql folder looks like:

Code:

INSERT INTO xcart_config VALUES ('default_currency', 'Select default currency', 'EUR', 'Multi_Currency', 10, 'text', 'EUR','','');

INSERT INTO xcart_modules (module_name, module_descr, active) VALUES ('Multi_Currency','This module adds a multi currency support.','Y');

CREATE TABLE xcart_currency_rate (
    code CHAR( 3 ) NOT NULL DEFAULT '',
    rate DECIMAL( 12, 5 ) NOT NULL DEFAULT '1.00000',
    active CHAR( 1 ) NOT NULL DEFAULT 'N',
    order_by INT( 11 ) NOT NULL DEFAULT '0',
    PRIMARY KEY  (code)
) TYPE=MyISAM;

INSERT INTO xcart_currency_rate (code) SELECT code FROM xcart_currencies;

UPDATE xcart_currency_rate SET active = 'Y' WHERE code = (SELECT value FROM xcart_config WHERE name = 'currency_symbol') OR code = (SELECT xcart_currencies.code FROM xcart_currencies INNER JOIN xcart_config ON xcart_currencies.symbol = xcart_config.value AND xcart_config.name = 'currency_symbol');

CREATE TABLE xcart_customer_currency (
    login VARCHAR ( 32 ) NOT NULL DEFAULT '',
    currency CHAR( 3 ) NOT NULL DEFAULT '',
    PRIMARY KEY  (login)
) TYPE=MyISAM;


I only added an empty string in the first line.

If you want to try it for yourself then please backup everything you can and don't chop off my head if something goes wrong, i never told that this is a nice solution, it' merely an unfinished fix :D

tqualizerman 10-22-2008 05:49 PM

Re: Multi currency modul
 
Can anyone help get this mod working? I am willing to pay for this.


All times are GMT -8. The time now is 02:23 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.