FOX - Currency Switcher for WooCommerce

WooCommerce — PayU Latam Gateway

  • Lien du plugin : https://wordpress.org/plugins/woocommerce-payu-latam-gateway/
    • ouvrez woocommerce-gateway-payulatam.php
    • trouvez la fonction __construct()
    • au lieu de :
      $this->currency = ($this->is_valid_currency()) ? get_woocommerce_currency() : 'USD';
      ajoutez le code suivant :
      if (class_exists('WOOCS'))
      {
          global $WOOCS;
          $curr = strtoupper($WOOCS->storage->get_val('woocs_current_currency'));
      } else
      {
          $curr = get_woocommerce_currency();
      }
      
      
      $this->currency = ($this->is_valid_currency()) ? $curr : 'USD';
      trouvez la fonction is_valid_currency() et remplacez tout le code par le code suivant :
      function is_valid_currency()
      {
          if (class_exists('WOOCS'))
          {
              global $WOOCS;
              $curr = strtoupper($WOOCS->storage->get_val('woocs_current_currency'));
          } else
          {
              $curr = get_woocommerce_currency();
          }
          //+++
          if (!in_array($curr, apply_filters('woocommerce_payulatam_supported_currencies', array('ARS', 'BRL', 'COP', 'MXN', 'PEN', 'USD'))))
              return false;
      
          return true;
      }