2015-12-08 12:45:18 +00:00
< div class = " wrap woocommerce " >
< h2 >< ? php _e ( 'Shipping Zones' , 'woocommerce' ); ?> </h2>
< p >< ? php _e ( 'Create shipping zones for all of the places you ship products to. Customers who enter a shipping address that isn\'t included in your shipping zones will receive a notice that there is no shipping available to their region.' , 'woocommerce' ); ?> <p>
< form >
< table class = " wc_shipping_zones widefat " >
< thead >
< tr >
< th class = " wc-shipping-zone-sort " >& nbsp ; </ th >
< th class = " wc-shipping-zone-name " > Zone Name </ th >
< th class = " wc-shipping-zone-region " > Region ( s ) </ th >
< th class = " wc-shipping-zone-methods " > Shipping Method ( s ) </ th >
2015-12-10 11:55:03 +00:00
< th class = " wc-shipping-zone-actions " >& nbsp ; </ th >
2015-12-08 12:45:18 +00:00
</ tr >
</ thead >
< tfoot >
< tr >
< td colspan = " 5 " >
2015-12-10 11:55:03 +00:00
< a class = " button button-secondary wc-shipping-zone-add " href = " # " >< ? php esc_html_e ( 'Add shipping zone' , 'woocommerce' ); ?> </a>
< input type = " submit " name = " save " class = " button button-primary " value = " Save shipping zones " />
2015-12-08 12:45:18 +00:00
</ td >
</ tr >
</ tfoot >
2015-12-10 11:55:03 +00:00
< tbody class = " wc-shipping-zone-rows " >
2015-12-08 12:45:18 +00:00
< tr >
< td width = " 1% " class = " wc-shipping-zone-sort " >
< input type = " hidden " name = " zone_order[] " value = " " >
</ td >
< td class = " wc-shipping-zone-name " >
< input type = " text " name = " " value = " " placeholder = " <?php esc_attr_e( 'Zone Name', 'woocommerce' ); ?> " />
</ td >
< td class = " wc-shipping-zone-region " >
< select multiple = " multiple " name = " " data - placeholder = " <?php _e( 'Select countries inside this zone', 'woocommerce' ); ?> " class = " wc-enhanced-select " >
< ? php
foreach ( $continents as $key => $continent ) {
echo '<optgroup label="' . esc_attr ( $continent [ 'name' ] ) . '">' ;
$countries = array_intersect ( array_keys ( $allowed_countries ), $continent [ 'countries' ] );
foreach ( $countries as $key ) {
echo '<option value="' . esc_attr ( $key ) . '">' . esc_html ( $allowed_countries [ $key ] ) . '</option>' ;
}
echo '</optgroup>' ;
}
?>
</ select >
< a href = " " > Limit to specific states </ a > | < a href = " " > Limit to specific zip codes </ a >
</ td >
< td ></ td >
2015-12-10 11:55:03 +00:00
< td class = " wc-shipping-zone-actions " >< a class = " delete " href = " # " >< ? php _e ( 'Delete' , 'woocommerce' ); ?> </a></td>
2015-12-08 12:45:18 +00:00
</ tr >
</ tbody >
< tbody >
< tr >
< td width = " 1% " class = " wc-shipping-zone-worldwide " ></ td >
< td class = " wc-shipping-zone-name " >
< ? php esc_html_e ( 'Worldwide' , 'woocommerce' ); ?>
</ td >
< td class = " wc-shipping-zone-region " >< ? php esc_html_e ( 'Shipping methods added here apply to all regions without a zone.' , 'woocommerce' ); ?> </td>
< td >
2015-12-10 11:55:03 +00:00
< a href = " # " class = " wc-shipping-zone-add-method button " >< ? php esc_html_e ( 'Add a shipping method' , 'woocommerce' ); ?> </a>
2015-12-08 12:45:18 +00:00
</ td >
2015-12-10 11:55:03 +00:00
< td class = " wc-shipping-zone-actions " >
< a class = " wc-shipping-zone-delete " href = " # " >< ? php _e ( 'Delete' , 'woocommerce' ); ?> </a>
</ td >
2015-12-08 12:45:18 +00:00
</ tr >
</ tbody >
</ table >
</ form >
</ div >
2015-12-10 11:55:03 +00:00
< script type = " text/html " id = " tmpl-wc-shipping-zone-row " >
< tr data - id = " { { data.zone_id }} " >
< td width = " 1% " class = " wc-shipping-zone-sort " ></ td >
< td class = " wc-shipping-zone-name " >
< div class = " view " > {{ data . zone_name }} </ div >
2015-12-10 15:09:37 +00:00
< div class = " edit " >< input type = " text " name = " zone_name[ { { data.zone_id }}] " data - attribute = " zone_name " value = " { { data.zone_name }} " placeholder = " <?php esc_attr_e( 'Zone Name', 'woocommerce' ); ?> " /></ div >
2015-12-10 11:55:03 +00:00
</ td >
2015-12-10 15:09:37 +00:00
< td class = " wc-shipping-zone-region " >
2015-12-10 17:07:18 +00:00
< div class = " view " > {{ data . formatted_zone_location }} </ div >
2015-12-10 15:09:37 +00:00
< div class = " edit " >
< select multiple = " multiple " name = " zone_locations[ { { data.zone_id }}] " data - attribute = " zone_locations " data - placeholder = " <?php _e( 'Select regions within this zone', 'woocommerce' ); ?> " class = " wc-shipping-zone-region-select " >
< ? php
foreach ( $continents as $continent_code => $continent ) {
echo '<option value="continent:' . esc_attr ( $continent_code ) . '" alt="">' . esc_html ( $continent [ 'name' ] ) . '</option>' ;
$countries = array_intersect ( array_keys ( $allowed_countries ), $continent [ 'countries' ] );
foreach ( $countries as $country_code ) {
echo '<option value="country:' . esc_attr ( $country_code ) . '" alt="' . esc_attr ( $continent [ 'name' ] ) . '">' . esc_html ( ' ' . $allowed_countries [ $country_code ] ) . '</option>' ;
if ( $states = WC () -> countries -> get_states ( $country_code ) ) {
foreach ( $states as $state_code => $state_name ) {
echo '<option value="state:' . esc_attr ( $country_code . ':' . $state_code ) . '" alt="' . esc_attr ( $continent [ 'name' ] . ' ' . $allowed_countries [ $country_code ] ) . '">' . esc_html ( ' ' . $state_name ) . '</option>' ;
}
}
}
}
?>
</ select >
< a href = " " >< ? php _e ( 'Limit to specific zip codes' , 'woocommerce' ); ?> </a>
</ div >
</ td >
< td class = " wc-shipping-zone-methods " >< a class = " wc-shipping-zone-add-method button " href = " # " >< ? php esc_html_e ( 'Add a shipping method' , 'woocommerce' ); ?> </a></td>
2015-12-10 11:55:03 +00:00
< td class = " wc-shipping-zone-actions " >
< a class = " wc-shipping-zone-delete " href = " # " >< ? php _e ( 'Delete' , 'woocommerce' ); ?> </a><a class="wc-shipping-zone-edit" href="#"><?php _e( 'Edit', 'woocommerce' ); ?></a>
</ td >
</ tr >
</ script >