woocommerce/admin/settings/settings-payment-gateways.php

66 lines
2.0 KiB
PHP
Raw Normal View History

<?php
/**
* Additional payment gateway settings
2012-08-14 13:33:15 +00:00
*
* @author WooThemes
* @category Admin
2012-08-14 13:33:15 +00:00
* @package WooCommerce/Admin/Settings
* @version 1.6.4
*/
2012-10-15 10:32:24 +00:00
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2012-08-14 13:33:15 +00:00
/**
* Output payment gateway settings.
*
* @access public
* @return void
*/
function woocommerce_payment_gateways_setting() {
global $woocommerce;
?>
<tr valign="top">
<td class="forminp" colspan="2">
<table class="wc_gateways widefat" cellspacing="0">
<thead>
<tr>
2012-10-16 09:45:33 +00:00
<th width="1%"><?php _e( 'Default', 'woocommerce' ); ?></th>
<th><?php _e( 'Gateway', 'woocommerce' ); ?></th>
<th><?php _e( 'Status', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ( $woocommerce->payment_gateways->payment_gateways() as $gateway ) :
2012-08-14 13:33:15 +00:00
$default_gateway = get_option('woocommerce_default_gateway');
2012-08-14 13:33:15 +00:00
echo '<tr>
<td width="1%" class="radio">
2012-10-16 14:46:21 +00:00
<input type="radio" name="default_gateway" value="' . esc_attr( $gateway->id ) . '" ' . checked( $default_gateway, esc_attr( $gateway->id ), false ) . ' />
<input type="hidden" name="gateway_order[]" value="' . esc_attr( $gateway->id ) . '" />
</td>
<td>
<p><strong>' . $gateway->get_title() . '</strong><br/>
2012-10-16 14:46:21 +00:00
<small>' . __( 'Gateway ID', 'woocommerce' ) . ': ' . esc_html( $gateway->id ) . '</small></p>
</td>
<td>';
2012-08-14 13:33:15 +00:00
if ( $gateway->enabled == 'yes' )
2012-12-03 12:15:45 +00:00
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success.png" width="16" height="14" alt="yes" />';
2012-08-14 13:33:15 +00:00
else
2012-12-03 12:15:45 +00:00
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off.png" width="16" height="14" alt="no" />';
2012-08-14 13:33:15 +00:00
echo '</td>
</tr>';
2012-08-14 13:33:15 +00:00
endforeach;
?>
</tbody>
</table>
</td>
</tr>
<?php
2012-08-14 13:33:15 +00:00
}
add_action( 'woocommerce_admin_field_payment_gateways', 'woocommerce_payment_gateways_setting' );