Microweber\Providers\ShopManager::currency_convert_rate PHP Method

currency_convert_rate() public method

public currency_convert_rate ( $from, $to )
    public function currency_convert_rate($from, $to)
    {
        return;
        $function_cache_id = __FUNCTION__ . md5($from . $to);
        $cache_group = 'shop';
        $cache_content = $this->app->cache_manager->get($function_cache_id, $cache_group);
        if ($cache_content != false) {
            return $cache_content;
        }
        if ($to == '') {
            $to = $from;
        }
        $remote_host = 'http://api.microweber.com';
        $service = '/service/currency/?from=' . $from . '&to=' . $to;
        $remote_host_s = $remote_host . $service;
        $curl = new \Microweber\Utils\Http();
        $curl->set_timeout(3);
        $curl->url($remote_host_s);
        $get_remote = $curl->get();
        if ($get_remote != false) {
            $this->app->cache_manager->save($get_remote, $function_cache_id, $cache_group);
            return floatval($get_remote);
        }
    }