1 of 2
1
“Deniro” Currency Converter Plugin
Posted: 27 October 2008 02:39 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

UPDATE: As of 26th November, 2009, this plugin has been renamed “Deniro”. Many of the comments posted below refer to the original plugin name and syntax. Please refer to the official Deniro documentation for full usage instructions.

—-

Hello all,

The Deniro plugin (formerly SL Currency Converter) automatically converts an amount from currency A to currency B, using live exchange rate data from xurrency.com.

The use of live exchange rate data makes it handy for sites that sell products in a single currency, but want to provide guideline equivalent prices for international shoppers, or for any application that requires easy programmatic access to up-to-date currency exchange rate data.

Full installation and usage instructions, and the plugin file, can be found on the official Deniro documentation page.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 27 October 2008 03:26 PM   [ Ignore ]   [ # 1 ]  
Chancellor's Fellow
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33338
Joined  05-15-2004

Thanks for sharing, I have been looking forward to that ever since I had first seen it on that webpage you were building.

Profile
MSG
 
 
Posted: 15 March 2009 09:46 AM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2020
Joined  08-04-2002

Cool, bet many could use this.

Profile
 
 
Posted: 16 March 2009 07:42 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  555
Joined  04-23-2008

This seems very useful! But I was wondering if there was any method of extracting this from custom fields?

I have a value custom field, and a currency custom field - is there a way to input them into this plugin?

Profile
 
 
Posted: 16 March 2009 09:18 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

Hi Mr Dimsum,

This seems very useful! But I was wondering if there was any method of extracting this from custom fields?

I have a value custom field, and a currency custom field - is there a way to input them into this plugin?

I’ve just tested the plugin with the following code, and it all works fine.

{exp:weblog:entries weblog="products" disable="categories|category_fields|member_data|pagination|trackbacks"}
<h2>{title}</h2>
{product-description}
<p>Price£{product-price} (${exp:sl_currencyconverter:convert amount="{product-price}" base="GBP" target="USD"}).</p>
{/exp:weblog:entries} 

Let me know if that’s not working for you, and I’ll try to find out what the problem is.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 05 April 2009 02:52 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  555
Joined  04-23-2008

Stephen,

I love this plugin. I also noticed that PutYourLightsOn also has almost an identical plugin at: http://www.putyourlightson.net/projects/exchange_rates

I was wondering if you had any experience with both services that are referenced for conversion and which one was more accurate, etc.

Both modules seem to great great and function relatively to a cue with one another. Good job both of you. =)

Profile
 
 
Posted: 06 April 2009 06:12 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

Hi Danny,

I was wondering if you had any experience with both services that are referenced for conversion and which one was more accurate, etc.

I knocked this plugin together very quickly for a client site some time ago, in order to provide an “indication” of the likely cost in alternative currencies. 100% accuracy wasn’t a concern, and as such isn’t something I’ve looked into.

Put simply, xurrency.com provides free currency conversion through a nice simple API, and that was enough for the client (and me) at the time.

Sorry I can’t be of more assistance; Ben over at PYLO may be able to offer a bit more insight.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 09 July 2009 06:34 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  192
Joined  06-20-2008

Is there a PHP way to get to the functions in this plugin? I’m using it OK in a template that parses PHP second, but I need to do it first, and have access to the conversion…

PHP second:

<?php 
// round up converted price, and add markup 
$price_rand {exp:sl_currencyconverter:convert amount="{price_rand}" base="ZAR" target="GBP"};
$markup {related_entries id="price_level"}{markup}{/related_entries};
                
$price_pounds ceil($price_rand) + $markup;
echo 
$price_pounds?> 

PHP first (assuming I’ve extracted the price to convert)?

<?php 
// round up converted price, and add markup 
$price_rand sl_currencyconverter($price_rand"ZAR""GBP");
$markup related_entries("price_level""markup");
                
$price_pounds ceil($price_rand) + $markup;
echo 
$price_pounds?> 
 Signature 

“Dude,I totally Swayze’d that mother.”
Project 14

Profile
 
 
Posted: 10 July 2009 08:15 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

Hi Luc,

The plugin is incredibly simple, so it’s probably a lot easier for you just to include something like the following in your PHP (note: I haven’t tested this code, but it should be about right).

$client = new SoapClient('http://xurrency.com/api.wsdl');

/**
 * Converts GBP100 to USD, and formats it for output.
 * You'll probably want to include some error checking.
 */
 
$converted_amount $client->getValue(100'GBP''USD');
echo 
'£100.00 is worth approximately $' round($converted_amount2) . '.'

Hope that helps,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 06 August 2009 08:48 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  192
Joined  06-20-2008

Turns out I can’t use it that way because of the way I’m parsing php to do something else on the page - either way will cause me a problem. So, in replay to this thread, is there anyway to use/mod the plugin to use a tag pair and a variable, ala:

{exp:sl_currencyconverter:convert amount="{price_rand}" base="ZAR" target="GBP" parse="inward"}
{exp
:simple_math calculate="ceil({converted_currency_value}) + {related_entries id="price_level"}{markup}{/related_entries}"}
{
/exp:sl_currencyconverter:convert} 

Thanks,

 Signature 

“Dude,I totally Swayze’d that mother.”
Project 14

Profile
 
 
Posted: 10 August 2009 03:35 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

Hi Luc,

So, in replay to this thread, is there anyway to use/mod the plugin to use a tag pair and a variable

It’s possible, but not something I have time to work on right now. I’m not sure the example code you provided above would work anyway, with the related entries tag nested inside a plugin parameter.

It strikes me that the simplest solution would be the one I mentioned above; a small bit of custom PHP, probably in a separate template. Enable PHP in the sub-template, embed it in your main template, and pass in whatever variables are required (base amount, base currency, target currency, and markup, for example).

That way, you don’t have to worry about parsing order or anything; you can just do your PHP calculations with the variables provided.

Hope that helps,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 10 August 2009 04:24 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  192
Joined  06-20-2008

Of course - I keep forgetting that PHP parse order is per template, you can embed them to parse it the opposite way… Good thinking Batman.

 Signature 

“Dude,I totally Swayze’d that mother.”
Project 14

Profile
 
 
Posted: 10 August 2009 04:34 AM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

Of course - I keep forgetting that PHP parse order is per template, you can embed them to parse it the opposite way… Good thinking Batman.

No problem.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 20 November 2009 08:18 PM   [ Ignore ]   [ # 13 ]  
Moderator
Avatar
RankRankRankRankRank
Total Posts:  3248
Joined  05-13-2004

Just tried out this plugin on a dev site and am very very happy with it.

Would it be possible to add an option to remove decimals i.e decimal=“no” and then the output would be limited to whole numbers? - I’m coverting to Korean won and the conversion spits out 35587.2 but decimal values are not used in Korean won.

on another note is there a way to force inclusion of commas where they occur in large numbers. The above price of 35587.2 is only us$30 so I expect to get some rather large numbers. Not sure if this can be done in this plugin or would need another plugin or php…

once again thanks for a fantastic plugin.

 Signature 

Recent version: EE 2.4.0 | 2.x Bug Tracker | How to Post a Support Request | Version Upgrade | 2.4.0 Change Log

on twitter @CS_sean

Profile
 
 
Posted: 23 November 2009 09:14 AM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

Hi Sean,

That all sounds perfectly doable, and not even particularly complex. I’m completely stacked with work at the moment, but will try to find a few minutes to make the necessary changes over the next week or so.

I’ve just realised that I haven’t even got round to adding this addon to GitHub, so I’ll sort that out too.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 23 November 2009 04:10 PM   [ Ignore ]   [ # 15 ]  
Moderator
Avatar
RankRankRankRankRank
Total Posts:  3248
Joined  05-13-2004

Stephen,

excellent - I’m in no rush - won’t be launching for a couple of more weeks at least.

 Signature 

Recent version: EE 2.4.0 | 2.x Bug Tracker | How to Post a Support Request | Version Upgrade | 2.4.0 Change Log

on twitter @CS_sean

Profile
 
 
Posted: 26 November 2009 08:26 AM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

Hi Sean,

The latest version (renamed Deniro) should meet your requirements.

You can also grab it from Git, should you be into that sort of thing.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 26 November 2009 05:26 PM   [ Ignore ]   [ # 17 ]  
Moderator
Avatar
RankRankRankRankRank
Total Posts:  3248
Joined  05-13-2004

Stephen,

works exactly as I wanted - thank you so much.

 Signature 

Recent version: EE 2.4.0 | 2.x Bug Tracker | How to Post a Support Request | Version Upgrade | 2.4.0 Change Log

on twitter @CS_sean

Profile
 
 
Posted: 26 November 2009 06:54 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  03-21-2006

works exactly as I wanted - thank you so much.

Marvellous. You’re welcome.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
   
1 of 2
1