Beispiel #1
0
 public static function getDefaultCurrencyCode()
 {
     if (!self::$defaultCurrencyCode) {
         $sql = "SELECT value FROM " . self::getTableName('core_config_data') . " WHERE path = 'currency/options/default'";
         if (self::useMySqli()) {
             //mysqli
             $result = mysqli_query(self::$mysqlidatabase, $sql);
             if (count($result)) {
                 while ($row = mysqli_fetch_array($result)) {
                     self::$defaultCurrencyCode = $row[0];
                 }
             }
         } else {
             //PDO
             if (count($result)) {
                 foreach (self::$pdodatabase->query($sql) as $row) {
                     while ($row = mysqli_fetch_array($result)) {
                         self::$defaultCurrencyCode = $row[0];
                     }
                 }
             }
         }
     }
     return self::$defaultCurrencyCode;
 }