businessdad

Currency Switcher - Add ECB provider from EU VAT Assistant

Jun 13th, 2020 (edited)
1,031
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.63 KB | None | 0 0
  1. <?Php
  2. /**
  3.  * Aelia Currency Switcher - Add ECB Rates Provider from the EU VAT Assistant
  4.  * to the list of the exhange rates providers used by the Currency Switcher.
  5.  *
  6.  * IMPORTANT
  7.  * This code should only be used when the Aelia Currency Switcher and EU VAT Assistant
  8.  * are active. If you disable the latter, please make sure that you select a different
  9.  * exchange rates provider, or the Currency Switcher could throw an error.
  10.  *
  11.  * GPL DISCLAIMER
  12.  * THE USE OF THIS CODE IS AS YOUR OWN RISK.
  13.  * This code is provided free of charge and comes without any warranty, implied or explicit, to the extent permitted
  14.  * by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the
  15.  * program "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied
  16.  * warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance
  17.  * of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair
  18.  * or correction.
  19.  *
  20.  * Need a consultation, or assistance to customise this code? Find us on Codeable: https://aelia.co/hire_us
  21.  */
  22. add_filter('wc_aelia_cs_exchange_rates_models', function($exchange_rates_models) {
  23.   if(class_exists('\Aelia\WC\EU_VAT_Assistant\Exchange_Rates_ECB_Model')) {
  24.     // Pass the ECB Model to the Currency Switcher
  25.     $exchange_rates_models['ecb'] = (object)array(
  26.     'class_name' => '\Aelia\WC\EU_VAT_Assistant\Exchange_Rates_ECB_Model',
  27.     'label' => 'ECB',
  28.     );
  29.   }
  30.  
  31.   return $exchange_rates_models;
  32. });
Advertisement
Add Comment
Please, Sign In to add comment