As I understand it, zencart requires a fixed point of reference and then you put in the currency conversion for all other currencies. There may be a way to hack around this, but what I think you are suggesting is in zencart when you create or edit a product, you want a list of currencies and how much to charge for the item for each currency regardless of conversion equality?
Otherwise, I think you may just be mixed up, if BTC is set as the default, and you set a product at that BTC value, then you would be adjusting the USD equivalent with the rate update script, and vice versa for USD is the default (frame of reference).
Anywho, as promised, here is a short little script to take the mtgox ticker and break it down into an array. I've included a curl function to make it even easier for you.
<?php
$data = curl_grab_page('https://mtgox.com/code/data/ticker.php');
$data = str_replace('{"ticker":','',$data);
$data = str_replace('}}','}',$data);
$mtgox = json_decode($data,true);
var_dump($mtgox); //This is your mtgox data, use this to perform some math and update the currency table
function
curl_grab_page($url,$ref_url,$data,$login,$proxy,$proxystatus){
if($login == 'true') {
$fp = fopen("cookie.txt", "w");
fclose($fp);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_TIMEOUT, 40);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
if ($proxystatus == 'true') {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, $ref_url);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
ob_start();
$output = curl_exec ($ch);
ob_end_clean();
curl_close ($ch);
unset($ch);
return $output;// execute the curl command
}
edit: realized i left a header() in there. removed.