mattsc Posted February 15, 2017 Share Posted February 15, 2017 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 More sharing options...
auzStar Posted February 15, 2017 Share Posted February 15, 2017 @@mattsc Matt, I think what you need is (as an example): $value = $value * $currencies->get_value('USD'); cheers My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
mattsc Posted February 15, 2017 Author Share Posted February 15, 2017 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.