diff --git a/includes/class-waves-gateway.php b/includes/class-waves-gateway.php index b9c302d..dc1e3fe 100644 --- a/includes/class-waves-gateway.php +++ b/includes/class-waves-gateway.php @@ -29,7 +29,7 @@ public function __construct() $this->has_fields = true; // assetCode+id if woocommerce_currency is set to Waves-like currency - $this->currencyIsWaves = in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin")); + $this->currencyIsWaves = in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin","POL")); if($this->currencyIsWaves) { if (get_woocommerce_currency() == "Waves") { $this->assetCode = 'Waves'; @@ -40,11 +40,13 @@ public function __construct() } else if (get_woocommerce_currency() == "ARTcoin") { $this->assetCode = 'ARTcoin'; $this->assetId = 'GQe2a2uReaEiHLdjzC8q4Popr9tnKonEpcaihEoZrNiR'; + } else if (get_woocommerce_currency() == "POL") { + $this->assetCode = 'POL'; + $this->assetId = 'Fx2rhWK36H1nfXsiD4orNpBm2QG1JrMhx3eUcPVcoZm2'; } } else { $this->assetId = $this->get_option('asset_id'); $this->assetCode = $this->get_option('asset_code'); - } if(empty($this->assetId)) { $this->assetId = null; diff --git a/readme.txt b/readme.txt index 98bedb0..d38b669 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: Waves: 3P4gvv7rZC1kFDobs4oQHN3H6NQckWiu9wz (tubbynl),3PFn9SGPJ8yVjc Tags: billing, invoicing, woocommerce, payment Requires at least: 3.0.1 Tested up to: 4.8 -Stable tag: 0.4.1 +Stable tag: 0.4.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -39,6 +39,8 @@ Install the plugin by uploading the zipfile in your WP admin interface or via FT == Changelog == +- 0.4.2 +* Added POL currency as static currency (conversion is skipped) - 0.4.1 * Waves conversions round on 2 decimals - 0.4.0 diff --git a/waves-gateway-for-woocommerce.php b/waves-gateway-for-woocommerce.php index 9a9f062..9bc00b6 100644 --- a/waves-gateway-for-woocommerce.php +++ b/waves-gateway-for-woocommerce.php @@ -6,7 +6,7 @@ * Plugin Name: WNET Gateway for Woocommerce (also for other Waves assets) * Plugin URI: https://github.com/wavesnode/gateway-for-woocommerce/ * Description: Show prices in Waves (or asset) and accept Waves payments in your woocommerce webshop - * Version: 0.4.1 + * Version: 0.4.2 * Author: Tubby / Useless Waves Token * License: GPLv2 or later * License URI: http://www.opensource.org/licenses/gpl-license.php @@ -113,6 +113,7 @@ public function WavesCurrencies( $currencies ) $currencies['WAVES'] = __( 'Waves', 'waves' ); $currencies['WNET'] = __( 'Wavesnode.NET', 'wnet' ); $currencies['ARTcoin'] = __( 'ARTcoin', 'ARTcoin' ); + $currencies['POL'] = __( 'POLTOKEN.PL', 'POL' ); return $currencies; } @@ -121,6 +122,7 @@ public function WavesCurrencySymbols( $currency_symbol, $currency ) { case 'WAVES': $currency_symbol = 'WAVES'; break; case 'WNET': $currency_symbol = 'WNET'; break; case 'ARTcoin': $currency_symbol = 'ARTcoin'; break; + case 'POL': $currency_symbol = 'POL'; break; } return $currency_symbol; } @@ -155,7 +157,7 @@ public function WavesFilterCartSubtotal($price, $cart_item, $cart_item_key) private function convertToWavesPrice($price_string, $price) { $options = get_option('woocommerce_waves_settings'); - if(!in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin")) && $options['show_prices'] == 'yes') { + if(!in_array(get_woocommerce_currency(), array("WAVES","WNET","ARTcoin","POL")) && $options['show_prices'] == 'yes') { $waves_currency = $options['asset_code']; if(empty($waves_currency)) { $waves_currency = 'Waves';