2016-01-19 17:57:03 +00:00
< ? php
2017-11-07 08:03:43 +00:00
/**
* Shipping classes admin
*
* @ package WooCommerce / Admin / Shipping
*/
2016-01-19 17:57:03 +00:00
if ( ! defined ( 'ABSPATH' ) ) {
exit ;
}
?>
2016-05-13 15:08:19 +00:00
< h2 >
2017-11-07 08:03:43 +00:00
< ? php esc_html_e ( 'Shipping classes' , 'woocommerce' ); ?>
< ? php echo wc_help_tip ( __ ( 'Shipping classes can be used to group products of similar type and can be used by some Shipping Methods (such as "Flat rate shipping") to provide different rates to different classes of product.' , 'woocommerce' ) ); // @codingStandardsIgnoreLine ?>
2016-05-13 15:08:19 +00:00
</ h2 >
2016-01-13 16:52:28 +00:00
< table class = " wc-shipping-classes widefat " >
2016-05-12 11:18:35 +00:00
< thead >
< tr >
2016-05-19 11:38:28 +00:00
< ? php foreach ( $shipping_class_columns as $class => $heading ) : ?>
< th class = " <?php echo esc_attr( $class ); ?> " >< ? php echo esc_html ( $heading ); ?> </th>
< ? php endforeach ; ?>
2016-05-12 11:18:35 +00:00
</ tr >
</ thead >
< tfoot >
< tr >
2017-11-07 08:03:43 +00:00
< td colspan = " <?php echo absint( count( $shipping_class_columns ) ); ?> " >
2017-11-07 08:05:32 +00:00
< button type = " submit " name = " save " class = " button button-primary wc-shipping-class-save " value = " <?php esc_attr_e( 'Save shipping classes', 'woocommerce' ); ?> " disabled >< ? php esc_html_e ( 'Save shipping classes' , 'woocommerce' ); ?> </button>
2016-10-12 10:16:30 +00:00
< a class = " button button-secondary wc-shipping-class-add " href = " # " >< ? php esc_html_e ( 'Add shipping class' , 'woocommerce' ); ?> </a>
2016-05-12 11:18:35 +00:00
</ td >
</ tr >
</ tfoot >
< tbody class = " wc-shipping-class-rows " ></ tbody >
2016-01-13 16:52:28 +00:00
</ table >
< script type = " text/html " id = " tmpl-wc-shipping-class-row-blank " >
< tr >
2017-11-07 08:03:43 +00:00
< td class = " wc-shipping-classes-blank-state " colspan = " <?php echo absint( count( $shipping_class_columns ) ); ?> " >< p >< ? php esc_html_e ( 'No shipping classes have been created.' , 'woocommerce' ); ?> </p></td>
2016-01-13 16:52:28 +00:00
</ tr >
</ script >
< script type = " text/html " id = " tmpl-wc-shipping-class-row " >
2016-05-12 11:18:35 +00:00
< tr data - id = " { { data.term_id }} " >
2016-05-19 11:38:28 +00:00
< ? php
2017-11-07 08:03:43 +00:00
foreach ( $shipping_class_columns as $class => $heading ) {
echo '<td class="' . esc_attr ( $class ) . '">' ;
switch ( $class ) {
case 'wc-shipping-class-name' :
?>
< div class = " view " >
{{ data . name }}
< div class = " row-actions " >
< a class = " wc-shipping-class-edit " href = " # " >< ? php esc_html_e ( 'Edit' , 'woocommerce' ); ?> </a> | <a href="#" class="wc-shipping-class-delete"><?php esc_html_e( 'Remove', 'woocommerce' ); ?></a>
2016-05-19 11:38:28 +00:00
</ div >
2017-11-07 08:03:43 +00:00
</ div >
< div class = " edit " >
< input type = " text " name = " name[ { { data.term_id }}] " data - attribute = " name " value = " { { data.name }} " placeholder = " <?php esc_attr_e( 'Shipping class name', 'woocommerce' ); ?> " />
< div class = " row-actions " >
< a class = " wc-shipping-class-cancel-edit " href = " # " >< ? php esc_html_e ( 'Cancel changes' , 'woocommerce' ); ?> </a>
2016-05-19 11:38:28 +00:00
</ div >
2017-11-07 08:03:43 +00:00
</ div >
< ? php
break ;
case 'wc-shipping-class-slug' :
?>
< div class = " view " > {{ data . slug }} </ div >
< div class = " edit " >< input type = " text " name = " slug[ { { data.term_id }}] " data - attribute = " slug " value = " { { data.slug }} " placeholder = " <?php esc_attr_e( 'Slug', 'woocommerce' ); ?> " /></ div >
< ? php
break ;
case 'wc-shipping-class-description' :
?>
< div class = " view " > {{ data . description }} </ div >
< div class = " edit " >< input type = " text " name = " description[ { { data.term_id }}] " data - attribute = " description " value = " { { data.description }} " placeholder = " <?php esc_attr_e( 'Description for your reference', 'woocommerce' ); ?> " /></ div >
< ? php
break ;
case 'wc-shipping-class-count' :
?>
< a href = " <?php echo esc_url( admin_url( 'edit.php?post_type=product&product_shipping_class=' ) ); ?> { { data.slug}} " > {{ data . count }} </ a >
< ? php
break ;
default :
do_action ( 'woocommerce_shipping_classes_column_' . $class );
break ;
2016-05-19 11:38:28 +00:00
}
2017-11-07 08:03:43 +00:00
echo '</td>' ;
}
2016-05-19 11:38:28 +00:00
?>
2016-05-12 11:18:35 +00:00
</ tr >
2016-01-13 16:52:28 +00:00
</ script >