public function test_get_the_order_currency()
 {
     $currency = get_the_order_currency_name(self::$order->get_id());
     $this->assertEquals($currency, APP_Currencies::get_name(self::$order->get_currency()));
     $this->expectOutputString($currency);
     the_order_currency(self::$order->get_id());
 }
/**
 * Returns the name of the current order's currency
 * @param $order_id (optional) If given, uses the specified order id, otherwise uses
 * 			the order currently being queried
 * @return string
 */
function get_the_order_currency_name($order_id = null)
{
    $order = get_order($order_id);
    return APP_Currencies::get_name($order->get_currency());
}
Exemple #3
0
 /**
  * Adds general order sections to the fields displayed
  * See view_transaction()
  * @param  array $sections 	Sections already being displayed
  * @param  APP_Order $order Order being processed
  * @return array           	$sections with added sections
  */
 public function display_order($sections, $order)
 {
     $sections['General Information'] = array('ID' => $order->get_id());
     $sections['Money & Currency'] = array('Currency' => APP_Currencies::get_name($order->get_currency()) . ' (' . $order->get_currency() . ')', 'Total' => APP_Currencies::get_price($order->get_total(), $order->get_currency()));
     return $sections;
 }
Exemple #4
0
 /**
  * Verifies that calling add_currency on an existing currency fails
  */
 public function test_add_overwrite_protection()
 {
     $status = APP_Currencies::add_currency('USD', array('name' => 'Not United States', 'symbol' => '###', 'display' => '{none}'));
     $this->assertFalse($status);
     $this->assertEquals(APP_Currencies::get_name('USD'), 'US Dollars');
 }