Plugin Directory

Changeset 3070955


Ignore:
Timestamp:
04/15/2024 03:44:08 PM (2 years ago)
Author:
outshifter
Message:

dinamically get currencies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • outshifter-export/trunk/index.php

    r3067044 r3070955  
    117117      self::log('Inicio - remove_api_keys');
    118118
    119       // Parte de la descripción que estamos buscando
    120119      $descripcion_buscada = "Reachu export";
    121120 
     
    125124 
    126125      foreach ($api_keys as $api_key) {
    127           // Verificar si la descripción contiene la subcadena buscada
    128126          if (strpos($api_key->description, $descripcion_buscada) !== false) {
    129127              $wpdb->delete($tabla_api_keys, ['key_id' => $api_key->key_id], ['%d']);
     
    11431141
    11441142    public static function fetch_currencies_for_settings() {
    1145       $response = self::call('/api/channels'); 
     1143      $response = self::call('/api/currencies'); 
    11461144      $options = array('' => '--'); 
    11471145      if (is_array($response)) {
    11481146        foreach ($response as $currency) {
    11491147          if (isset($currency->enabled) && $currency->enabled == 1) {
    1150             $options[$currency->name] = $currency->name;
     1148            $options[$currency->currency_code] = $currency->currency_code;
    11511149          }
    11521150        }
     
    11761174          'id' => 'wc_reachu_currency',
    11771175          'default' => '',
    1178           //'options' => self::fetch_currencies_for_settings(),
    1179           'options' => array(
    1180             '' => '--',
    1181             'EUR' => 'EUR',
    1182             'USD' => 'USD',
    1183             'NOK' => 'NOK',
    1184             'DKK' => 'DKK',
    1185             'SEK' => 'SEK',
    1186             'CHF' => 'CHF',
    1187             'GBP' => 'GBP',
    1188           ),
     1176          'options' => self::fetch_currencies_for_settings(),
    11891177          'class' => 'reachu-currency-select',
    11901178        ),
Note: See TracChangeset for help on using the changeset viewer.