/**
  * Verify currency strings return properly
  */
 public function test_currency_string()
 {
     $string = APP_Currencies::get_currency_string('USD');
     $this->assertEquals('US Dollars ($)', $string);
     $string_array = APP_Currencies::get_currency_string_array();
     $this->assertInternalType('array', $string_array);
     $this->assertContains($string, $string_array);
 }
Пример #2
0
    /**
     * Displays the order status summary
     * @param  object $post Wordpress Post object
     * @return void
     */
    function display($post)
    {
        $order = appthemes_get_order($post->ID);
        ?>
		<style type="text/css">
			#admin-order-status th{
				padding-right: 10px;
				text-align: right;
				width: 40%;
			}
		</style>
		<table id="admin-order-status">
			<tbody>
				<tr>
					<th><?php 
        _e('ID', APP_TD);
        ?>
: </th>
					<td><?php 
        echo $order->get_ID();
        ?>
</td>
				</tr>
				<tr>
					<th><?php 
        _e('Status', APP_TD);
        ?>
: </th>
					<td><?php 
        echo $order->get_display_status();
        ?>
</td>
				</tr>
				<tr>
					<th><?php 
        _e('Gateway', APP_TD);
        ?>
: </th>
					<td>
					<?php 
        $gateway_id = $order->get_gateway();
        if (!empty($gateway_id)) {
            $gateway = APP_Gateway_Registry::get_gateway($gateway_id);
            if ($gateway) {
                echo $gateway->display_name('admin');
            } else {
                _e('Unknown', APP_TD);
            }
        } else {
            _e('Undecided', APP_TD);
        }
        ?>
					</td>
				</tr>
				<tr>
					<th><?php 
        _e('Currency', APP_TD);
        ?>
: </th>
					<td><?php 
        echo APP_Currencies::get_currency_string($order->get_currency());
        ?>
</td>
				</tr>
				<?php 
        if ($order->is_recurring()) {
            $period = $order->get_recurring_period();
            ?>
				<tr>
					<th><?php 
            _e('Recurs:', APP_TD);
            ?>
</th>
					<td><?php 
            printf(_n('Every day', 'Every %d days', $period, APP_TD), $period);
            ?>
</td>
				</tr>
				<tr>
					<th><?php 
            _e('Payment Date:', APP_TD);
            ?>
</th>
					<td><?php 
            echo appthemes_display_date(get_post($order->get_id())->post_date, 'date');
            ?>
</td>
				</tr>
				<?php 
        }
        ?>
				<?php 
        if ($order->get_parent() != 0) {
            ?>
				<tr>
					<th><?php 
            _e('Previously', APP_TD);
            ?>
</th>
					<td><a href="<?php 
            echo get_edit_post_link($order->get_parent());
            ?>
">#<?php 
            echo $order->get_parent();
            ?>
</a></td>
				</tr>
				<?php 
        }
        ?>
			</tbody>
		</table>
		<?php 
    }