Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

currency calculation if XXX calculate USD


mattsc

Recommended Posts

How do I retrieve a given currency conversion rate value?

 

I have an issue where if an arbitrary currency is being used, other than USD, I need to convert the value to use a specified currency codes current conversion rate which can be different that the currently selected display currency. I can of course just go query the database natively, but I would suppose there's an actual SUPPORTED method of doing this in the OSC realms.

 

Basically what I'm trying to do is a:

$value = $value * (specified currency codes exchange rate)

 

So if I need to use USD it would be

$value = $value * (current USD exchange rate)

 

or if I needed EURO it would be

$value = $value * (current EURO exchange rate) 

Link to comment
Share on other sites

@@mattsc

 

Matt, I think what you need is (as an example):

 

$value = $value * $currencies->get_value('USD');

 

cheers

 

 

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

Matt, I think what you need is (as an example):

 

$value = $value * $currencies->get_value('USD');

 

 

Perfect. A quick adding of the currencies global also stuck in there, and that's exactly what I needed. Thanks! :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...