Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Update currencies for slovak customers


roman3x

Recommended Posts

Posted

It's useful only for Slovak customers.

In file admin/includes/functions/localization.php update new function for example on line 12:

  function quote_nbs_currency($code, $base = DEFAULT_CURRENCY) {
   if ($base<>"SKK") return false;
   if ($code=="SKK") return "1.000";
   $page = fopen ("http://www.nbs.sk/KL/AKTKLSL.SDF","r");
   while($erg = fgets($page, 63)){
     $mena = substr($erg, 35, 3);
     if ($mena==$code){
       $pomer=0+substr($erg, 30, 4);
       $kurz=substr($erg, 39, 8);
       $vystup=$kurz/$pomer;
       $vystup="".$vystup;
       if (sizeof($vystup) > 0) {
         return $vystup;
       } else {
         return false;
       }
     }
   }
 }

In file admin/includes/application_top on line n. 54,55 change variables of financial servers to "nbs":

define('CURRENCY_SERVER_PRIMARY', 'nbs');
define('CURRENCY_SERVER_BACKUP', 'nbs');

If you will use default currency not SKK, will generate error.

  • 2 years later...
Posted
... $vystup=$kurz/$pomer;
If using this script, you very probaly would get the result saying thet 1 SK= 33EUR. You have tochange the formula to:

$vystup=$pomer/$kurz;

Archived

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

×
×
  • Create New...