woocommerce/admin/settings/settings-shipping-methods.php

67 lines
2.1 KiB
PHP
Raw Normal View History

<?php
/**
* Additional shipping 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 shipping method settings.
*
* @access public
* @return void
*/
function woocommerce_shipping_methods_setting() {
global $woocommerce;
?>
<tr valign="top">
2012-10-16 09:45:33 +00:00
<th scope="row" class="titledesc"><?php _e( 'Shipping Methods', 'woocommerce' ) ?></th>
<td class="forminp">
2012-10-16 09:45:33 +00:00
<p class="description" style="margin-top: 0;"><?php _e( 'Drag and drop methods to control their display order.', 'woocommerce' ); ?></p>
<table class="wc_shipping widefat" cellspacing="0">
<thead>
<tr>
2012-10-16 09:45:33 +00:00
<th><?php _e( 'Default', 'woocommerce' ); ?></th>
<th><?php _e( 'Shipping Method', 'woocommerce' ); ?></th>
<th><?php _e( 'Status', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php
2012-05-29 12:32:54 +00:00
foreach ( $woocommerce->shipping->load_shipping_methods() as $method ) {
2012-08-14 13:33:15 +00:00
2012-10-16 14:46:21 +00:00
$default_shipping_method = esc_attr( get_option('woocommerce_default_shipping_method') );
2012-08-14 13:33:15 +00:00
echo '<tr>
<td width="1%" class="radio">
<input type="radio" name="default_shipping_method" value="' . $method->id . '" ' . checked( $default_shipping_method, $method->id, false ) . ' />
<input type="hidden" name="method_order[]" value="' . $method->id . '" />
<td>
<p><strong>' . $method->get_title() . '</strong><br/>
2012-10-16 09:45:33 +00:00
<small>' . __( 'Method ID', 'woocommerce' ) . ': ' . $method->id . '</small></p>
</td>
<td>';
2012-08-14 13:33:15 +00:00
if ($method->enabled == 'yes')
2013-02-13 15:56:47 +00:00
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success@2x.png" width="16 height="14" alt="yes" />';
2012-08-14 13:33:15 +00:00
else
2013-02-13 15:56:47 +00:00
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off@2x.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
}
?>
</tbody>
</table>
</td>
</tr>
<?php
2012-08-14 13:33:15 +00:00
}
add_action( 'woocommerce_admin_field_shipping_methods', 'woocommerce_shipping_methods_setting' );