Hide tax options when disabled. Closes #2205.

This commit is contained in:
Mike Jolley 2013-01-10 16:37:27 +00:00
parent 8baa368ffa
commit abd3f521ec
2 changed files with 22 additions and 16 deletions

View File

@ -120,11 +120,13 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
echo wp_dropdown_categories( $args );
?></td>
<td>
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
<label><?php _e( 'Tax class:', 'woocommerce' ); ?></label>
<select name="variable_tax_class[<?php echo $loop; ?>]"><?php
foreach ( $parent_data['tax_class_options'] as $key => $value )
echo '<option value="' . esc_attr( $key ) . '" ' . selected( $key, $_tax_class, false ) . '>' . esc_html( $value ) . '</option>';
?></select>
<?php endif; ?>
</td>
</tr>
<tr class="show_if_variation_downloadable">

View File

@ -170,6 +170,8 @@ function woocommerce_product_data_box() {
echo '</div>';
if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) {
echo '<div class="options_group show_if_simple show_if_external show_if_variable">';
// Tax
@ -192,6 +194,8 @@ function woocommerce_product_data_box() {
echo '</div>';
}
do_action( 'woocommerce_product_options_general_product_data' );
?>
</div>