improved the tax name in order item fee
This commit is contained in:
parent
7f4b768c2a
commit
911b1699ee
|
@ -18,32 +18,33 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) :
|
||||||
|
$tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('woocommerce_tax_classes' ) ) ) );
|
||||||
|
$classes_options = array();
|
||||||
|
$classes_options[''] = __( 'Standard', 'woocommerce' );
|
||||||
|
$tax_class = isset( $item['tax_class'] ) ? sanitize_title( $item['tax_class'] ) : '';
|
||||||
|
|
||||||
|
if ( $tax_classes ) {
|
||||||
|
foreach ( $tax_classes as $class ) {
|
||||||
|
$classes_options[ sanitize_title( $class ) ] = $class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
<td class="tax_class" width="1%">
|
<td class="tax_class" width="1%">
|
||||||
<div class="view">
|
<div class="view">
|
||||||
<?php
|
<?php
|
||||||
$item_value = isset( $item['tax_class'] ) ? sanitize_title( $item['tax_class'] ) : '';
|
$item_value = isset( $classes_options[ $tax_class ] ) ? esc_attr( $classes_options[ $tax_class ] ) : '';
|
||||||
echo $item_value ? $item_value : __( 'Standard', 'woocommerce' );
|
echo $item_value ? $item_value : __( 'Standard', 'woocommerce' );
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="edit" style="display:none">
|
<div class="edit" style="display:none">
|
||||||
<select class="tax_class" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" title="<?php _e( 'Tax class', 'woocommerce' ); ?>">
|
<select class="tax_class" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" title="<?php _e( 'Tax class', 'woocommerce' ); ?>">
|
||||||
<?php $tax_class = isset( $item['tax_class'] ) ? sanitize_title( $item['tax_class'] ) : ''; ?>
|
|
||||||
<option value="0" <?php selected( 0, $tax_class ) ?>><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
<option value="0" <?php selected( 0, $tax_class ) ?>><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
||||||
<optgroup label="<?php _e( 'Taxable', 'woocommerce' ); ?>">
|
<optgroup label="<?php _e( 'Taxable', 'woocommerce' ); ?>">
|
||||||
<?php
|
<?php
|
||||||
$tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('woocommerce_tax_classes' ) ) ) );
|
foreach ( $classes_options as $value => $name ) {
|
||||||
|
echo '<option value="' . esc_attr( $value ) . '" ' . selected( $value, $tax_class, false ) . '>'. esc_html( $name ) . '</option>';
|
||||||
$classes_options = array();
|
}
|
||||||
$classes_options[''] = __( 'Standard', 'woocommerce' );
|
|
||||||
|
|
||||||
if ( $tax_classes )
|
|
||||||
foreach ( $tax_classes as $class )
|
|
||||||
$classes_options[ sanitize_title( $class ) ] = $class;
|
|
||||||
|
|
||||||
foreach ( $classes_options as $value => $name )
|
|
||||||
echo '<option value="' . esc_attr( $value ) . '" ' . selected( $value, $tax_class, false ) . '>'. esc_html( $name ) . '</option>';
|
|
||||||
?>
|
?>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue