diff --git a/monero/include/monero_payments.php b/monero/include/monero_payments.php index 1237602..63589d0 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -42,15 +42,41 @@ class Monero_Gateway extends WC_Payment_Gateway /* Save Settings */ add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this,'process_admin_options' )); + add_filter( 'woocommerce_currencies', array($this,'add_monero'), 10, 2 ); + + + +add_filter('woocommerce_currency_symbol',array($this, 'add_monero_symbol'), 10, 2); + add_action('woocommerce_email_before_order_table', array($this, 'email_instructions'), 10, 2); + + + + + } $this->monero_daemon = new Monero_Library($this->host . ':' . $this->port . '/json_rpc', $this->username, $this->password); } + public function add_monero( $currencies ) { + $currencies['XMR'] = __( 'Monero', 'woocommerce' ); + return $currencies; +} +public function add_monero_symbol( $currency_symbol, $currency ) { + switch( $currency ) { + case 'XMR': + $currency_symbol = 'XMR'; + break; + } + return $currency_symbol; +} + + public function admin_options() { $this->log->add('Monero_gateway', '[SUCCESS] Monero Settings OK'); - echo ""; + echo "
Welcome to Monero Extension for WooCommerce. Getting started: Make a connection with daemon Contact Me"; echo "