2016-01-19 17:57:03 +00:00
< ? php
if ( ! defined ( 'ABSPATH' ) ) {
exit ;
}
?>
2017-02-01 09:25:42 +00:00
< h2 class = " wc-shipping-zones-heading " >
2016-10-12 10:16:30 +00:00
< ? php _e ( 'Shipping zones' , 'woocommerce' ); ?>
2016-09-24 02:22:57 +00:00
< a href = " <?php echo admin_url( 'admin.php?page=wc-settings&tab=shipping&zone_id=new' ); ?> " class = " page-title-action " >< ? php esc_html_e ( 'Add shipping zone' , 'woocommerce' ); ?> </a>
2016-05-13 15:08:19 +00:00
</ h2 >
2016-09-24 02:22:57 +00:00
< p >< ? php echo __ ( 'A shipping zone is a geographic region where a certain set of shipping methods are offered.' , 'woocommerce' ) . ' ' . __ ( 'WooCommerce will match a customer to a single zone using their shipping address and present the shipping methods within that zone to them.' , 'woocommerce' ); ?> </p>
2016-01-05 11:23:15 +00:00
< table class = " wc-shipping-zones widefat " >
2016-05-12 10:07:18 +00:00
< thead >
< tr >
< th class = " wc-shipping-zone-sort " >< ? php echo wc_help_tip ( __ ( 'Drag and drop to re-order your custom zones. This is the order in which they will be matched against the customer address.' , 'woocommerce' ) ); ?> </th>
2016-10-12 10:16:30 +00:00
< th class = " wc-shipping-zone-name " >< ? php esc_html_e ( 'Zone name' , 'woocommerce' ); ?> </th>
2016-05-12 10:07:18 +00:00
< th class = " wc-shipping-zone-region " >< ? php esc_html_e ( 'Region(s)' , 'woocommerce' ); ?> </th>
2016-10-12 10:16:30 +00:00
< th class = " wc-shipping-zone-methods " >< ? php esc_html_e ( 'Shipping method(s)' , 'woocommerce' ); ?> </th>
2016-05-12 10:07:18 +00:00
</ tr >
</ thead >
< tbody class = " wc-shipping-zone-rows " ></ tbody >
< tbody >
2017-06-06 12:46:09 +00:00
< tr data - id = " 0 " class = " wc-shipping-zone-worldwide " >
2016-05-12 10:07:18 +00:00
< td width = " 1% " class = " wc-shipping-zone-worldwide " ></ td >
< td class = " wc-shipping-zone-name " >
2017-06-06 12:46:09 +00:00
< a href = " <?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping&zone_id=0' ) ); ?> " >< ? php esc_html_e ( 'Locations not covered by your other zones' , 'woocommerce' ); ?> </a>
2016-10-11 10:46:23 +00:00
< div class = " row-actions " >
2017-06-06 12:46:09 +00:00
< a href = " admin.php?page=wc-settings&tab=shipping&zone_id=0 " >< ? php _e ( 'Manage shipping methods' , 'woocommerce' ); ?> </a>
2016-10-11 10:46:23 +00:00
</ div >
2016-05-12 10:07:18 +00:00
</ td >
2016-09-24 02:22:57 +00:00
< td class = " wc-shipping-zone-region " >< ? php _e ( 'This zone is <b>optionally</b> used for regions that are not included in any other shipping zone.' , 'woocommerce' ); ?> </td>
2016-05-12 10:07:18 +00:00
< td class = " wc-shipping-zone-methods " >
2016-03-24 17:26:40 +00:00
< ul >
< ? php
$worldwide = new WC_Shipping_Zone ( 0 );
$methods = $worldwide -> get_shipping_methods ();
2016-07-21 13:30:05 +00:00
uasort ( $methods , 'wc_shipping_zone_method_order_uasort_comparison' );
2015-12-16 13:38:03 +00:00
2016-06-06 18:15:40 +00:00
if ( ! empty ( $methods ) ) {
2016-03-24 17:26:40 +00:00
foreach ( $methods as $method ) {
2016-05-12 10:07:18 +00:00
$class_name = 'yes' === $method -> enabled ? 'method_enabled' : 'method_disabled' ;
2016-10-10 16:50:29 +00:00
echo '<li class="wc-shipping-zone-method ' . esc_attr ( $class_name ) . '">' . esc_html ( $method -> get_title () ) . '</li>' ;
2016-03-24 17:26:40 +00:00
}
2016-04-21 15:18:15 +00:00
} else {
2016-06-20 11:50:52 +00:00
echo '<li class="wc-shipping-zone-method">' . __ ( 'No shipping methods offered to this zone.' , 'woocommerce' ) . '</li>' ;
2016-01-05 11:23:15 +00:00
}
2016-03-24 17:26:40 +00:00
?>
</ ul >
2016-01-05 11:23:15 +00:00
</ td >
2016-05-12 10:07:18 +00:00
</ tr >
</ tbody >
2016-01-05 11:23:15 +00:00
</ table >
2015-12-10 11:55:03 +00:00
2015-12-16 15:37:40 +00:00
< script type = " text/html " id = " tmpl-wc-shipping-zone-row-blank " >
2016-04-22 10:13:39 +00:00
< ? php if ( 0 === $method_count ) : ?>
< tr >
2016-10-11 10:46:23 +00:00
< td class = " wc-shipping-zones-blank-state " colspan = " 4 " >
2016-04-22 10:13:39 +00:00
< p class = " main " >< ? php _e ( 'A shipping zone is a geographic region where a certain set of shipping methods and rates apply.' , 'woocommerce' ); ?> </p>
< p >< ? php _e ( 'For example:' , 'woocommerce' ); ?> </p>
< ul >
2016-10-12 10:16:30 +00:00
< li >< ? php _e ( 'Local zone = California ZIP 90210 = Local pickup' , 'woocommerce' ); ?>
< li >< ? php _e ( 'US domestic zone = All US states = Flat rate shipping' , 'woocommerce' ); ?>
< li >< ? php _e ( 'Europe zone = Any country in Europe = Flat rate shipping' , 'woocommerce' ); ?>
2016-04-22 10:13:39 +00:00
</ ul >
< p >< ? php _e ( 'Add as many zones as you need – customers will only see the methods available for their address.' , 'woocommerce' ); ?> </p>
2017-01-17 15:25:12 +00:00
< a class = " button button-primary wc-shipping-zone-add " href = " <?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping&zone_id=new' ) ); ?> " >< ? php _e ( 'Add shipping zone' , 'woocommerce' ); ?> </a>
2016-04-22 10:13:39 +00:00
</ td >
</ tr >
< ? php endif ; ?>
2015-12-16 15:37:40 +00:00
</ script >
2015-12-10 11:55:03 +00:00
< script type = " text/html " id = " tmpl-wc-shipping-zone-row " >
2016-05-12 10:07:18 +00:00
< tr data - id = " { { data.zone_id }} " >
< td width = " 1% " class = " wc-shipping-zone-sort " ></ td >
< td class = " wc-shipping-zone-name " >
2016-09-24 02:22:57 +00:00
< a href = " admin.php?page=wc-settings&tab=shipping&zone_id= { { data.zone_id }} " > {{ data . zone_name }} </ a >
2016-10-11 10:46:23 +00:00
< div class = " row-actions " >
< a href = " admin.php?page=wc-settings&tab=shipping&zone_id= { { data.zone_id }} " >< ? php _e ( 'Edit' , 'woocommerce' ); ?> </a> | <a href="#" class="wc-shipping-zone-delete"><?php _e( 'Delete', 'woocommerce' ); ?></a>
</ div >
2016-05-12 10:07:18 +00:00
</ td >
2015-12-10 15:09:37 +00:00
< td class = " wc-shipping-zone-region " >
2016-09-24 02:22:57 +00:00
{{ data . formatted_zone_location }}
2015-12-10 15:09:37 +00:00
</ td >
2016-05-12 10:07:18 +00:00
< td class = " wc-shipping-zone-methods " >
2016-09-24 02:22:57 +00:00
< div >< ul ></ ul ></ div >
2015-12-11 14:11:12 +00:00
</ td >
2016-05-12 10:07:18 +00:00
</ tr >
2015-12-10 11:55:03 +00:00
</ script >
2016-01-13 15:04:10 +00:00
< script type = " text/template " id = " tmpl-wc-modal-add-shipping-method " >
< div class = " wc-backbone-modal " >
< div class = " wc-backbone-modal-content " >
< section class = " wc-backbone-modal-main " role = " main " >
< header class = " wc-backbone-modal-header " >
2016-03-29 18:51:09 +00:00
< h1 >< ? php _e ( 'Add shipping method' , 'woocommerce' ); ?> </h1>
2016-01-13 15:04:10 +00:00
< button class = " modal-close modal-close-link dashicons dashicons-no-alt " >
< span class = " screen-reader-text " >< ? php _e ( 'Close modal panel' , 'woocommerce' ); ?> </span>
</ button >
</ header >
< article >
< form action = " " method = " post " >
2016-05-12 10:07:18 +00:00
< div class = " wc-shipping-zone-method-selector " >
2016-06-20 11:50:52 +00:00
< p >< ? php esc_html_e ( 'Choose the shipping method you wish to add. Only shipping methods which support zones are listed.' , 'woocommerce' ); ?> </p>
2016-05-12 10:07:18 +00:00
< select name = " add_method_id " >
< ? php
foreach ( WC () -> shipping -> load_shipping_methods () as $method ) {
if ( ! $method -> supports ( 'shipping-zones' ) ) {
continue ;
}
2017-01-17 15:50:19 +00:00
echo '<option data-description="' . esc_attr ( wp_kses_post ( wpautop ( $method -> get_method_description () ) ) ) . '" value="' . esc_attr ( $method -> id ) . '">' . esc_attr ( $method -> get_method_title () ) . '</li>' ;
2016-05-12 10:07:18 +00:00
}
?>
</ select >
< input type = " hidden " name = " zone_id " value = " { { { data.zone_id }}} " />
</ div >
2016-01-13 15:04:10 +00:00
</ form >
</ article >
< footer >
< div class = " inner " >
2016-03-29 18:51:09 +00:00
< button id = " btn-ok " class = " button button-primary button-large " >< ? php _e ( 'Add shipping method' , 'woocommerce' ); ?> </button>
2016-01-13 15:04:10 +00:00
</ div >
</ footer >
</ section >
</ div >
</ div >
< div class = " wc-backbone-modal-backdrop modal-close " ></ div >
</ script >