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

Multiple Currencies Mod Complete (v4.1.2)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-24-2006, 07:07 PM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default Multiple Currencies Mod Complete (v4.1.2)

Well after a good day or two plugging away I've finally finished a little mod that will allow the customer to select which alternate currency they want prices displayed in. They can choose a currency code using a drop-down list and then the current page will refresh and display the alternate price next to the regular price. The selected currency is also stored as a cookie so subsequent pages remember which currencies to display.

I've also added a simple admin configuration area that lets you change the rates manually.

This is a fairly basic mod in that it does NOT get the latest rates from any bank (I tried at one point but it seems most want to charge fees, etc, etc). It does NOT let you log in as an administrator and add unlimited currency codes & rates (I started to do this but realized my client could probably care less and I don't really have another day to throw around). I think you guys know how it is. Right now to add another currency code it involves adding an entry to a table and a couple lines of PHP code to a file. Easy as pie, well for an engineer that is, just not something my mother could do.

Another thing this mod does NOT do is charge the user in a foreign currency. This ONLY displays alternate currencies so the user can see product prices and cart prices in BOTH default and user-selected alternate currencies.

BTW, I have this running on X-Cart 4.1.2 Gold and have done my testing on Firefox 1.5.04 and IE 6.

Also, here are a few screenshots.

The main home page with the drop-down list:
http://hurai.dreamhosters.com/images/xcart/home-select.jpg

The admin configuration page:
http://hurai.dreamhosters.com/images/xcart/admin.jpg

UPDATE: you'll need to run the following commands through the database to add text labels to the language table.

INSERT INTO `xcart_languages` VALUES ('US', 'lbl_currencies', 'Currencies', 'Labels');
INSERT INTO `xcart_languages` VALUES ('US', 'option_title_Multiple_Currency', 'Multiple Currencies Options', 'Labels');

And then one more query to add the custom module to X-Cart:

INSERT INTO `xcart_modules` VALUES (74, 'Multiple_Currency', 'Enables users to select different currencies to be displayed.', 'Y');

Once you do this, go into the Administrator - Modules area and make sure you see it there and make sure it IS enabled.

I've put this mod on my website for you to download here.

Password is: koaconsulting.com
__________________
X-Cart Gold v4.1.2
(running on a unix server)
Reply With Quote
  #2  
Old 07-25-2006, 03:23 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Looks like a good mod...but the Completed Mods forum is for posting Completed Code only. Let me know when you have the code posted and I'll move it back to that forum.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 07-27-2006, 11:33 PM
 
mlivio@vo.lu mlivio@vo.lu is offline
 

Advanced Member
  
Join Date: Jul 2006
Posts: 89
 

Default multiple currencies

Hi koaloa,

I would like to try your multiple currencies package, can I download it somewhere ?


Thanks.
__________________
http://www.febbredoro.com

Version 4.0.19
Reply With Quote
  #4  
Old 08-04-2006, 07:06 AM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

Very good, can you share the code ?
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #5  
Old 08-04-2006, 12:21 PM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default

Please take a look at my original post as I've put a download link to a zipfile with the mod with install instructions. Hope you like it.

Hurai
__________________
X-Cart Gold v4.1.2
(running on a unix server)
Reply With Quote
  #6  
Old 08-04-2006, 01:32 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

Thanx, very well explained, Im going to try it out to see how it works.
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #7  
Old 08-04-2006, 06:03 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

In my General Settings, I get an arrow and no text. Is there a missing language variable?

Modified the tpl's - added a field in the currencies table, but nothing shows up....

- Mike
__________________
4.1.9
Reply With Quote
  #8  
Old 08-04-2006, 06:16 PM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default

Hey Mike,
Sorry about that. I thought I was being so diligent explaining everything and documenting each item I changed. I've updated my post above to reflect two more language additions I made.

You need to run these commands on the table:
INSERT INTO `xcart_languages` VALUES ('US', 'lbl_currencies', 'Currencies', 'Labels');
INSERT INTO `xcart_languages` VALUES ('US', 'option_title_Multiple_Currency', 'Multiple Currencies Options', 'Labels');

Or you can just enter these values into the administrator - language section of X-Cart:

lbl_currencies - 'Currencies'
option_title_Multiple_Currency - 'Multiple Currencies Options'

Remember to wipe out your cache if these don't show up right away, I learned that the hard way (after hitting refresh about 30 times and then browsing the forums).

Let me know how it goes, it's actually pretty neat once it all works.
__________________
X-Cart Gold v4.1.2
(running on a unix server)
Reply With Quote
  #9  
Old 08-05-2006, 01:12 AM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

Half way there. I see a form action for shop.php in the tpl, is that your own page? I can't get any options to show up though.... there might be something else missing here?

Thanks,

Mike
__________________
4.1.9
Reply With Quote
  #10  
Old 08-05-2006, 09:44 AM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default

Ah, I may have found the culprit. You need to run this mySQL query to add the custom module to X-Cart:

INSERT INTO `xcart_modules` VALUES (74, 'Multiple_Currency', 'Enables users to select different currencies to be displayed.', 'Y');

Once you do this, go into the Administrator - Modules area and make sure you see it there and make sure it IS enabled.

Sorry for the run-around. I think you're close!
__________________
X-Cart Gold v4.1.2
(running on a unix server)
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 04:37 PM.

   

 
X-Cart forums © 2001-2020