Last commit was a bit rude. Also hide panels containing the data. Closes #892

This commit is contained in:
Coen Jacobs 2012-04-05 10:46:39 +02:00
parent 2fa6a9313d
commit 57570b62c1
2 changed files with 13 additions and 8 deletions

View File

@ -5,7 +5,10 @@
global $woocommerce, $post, $product;
if ($product->has_attributes() || $product->has_dimensions() || $product->has_weight()) : ?>
$show_attr = ( get_option( 'woocommerce_enable_dimension_product_attributes' ) == 'yes' ? true : false );
if ( $product->has_attributes() || ( $show_attr && $product->has_dimensions() ) || ( $show_attr && $product->has_weight() ) ) {
?>
<div class="panel" id="tab-attributes">
<?php $heading = apply_filters('woocommerce_product_additional_information_heading', __('Additional Information', 'woocommerce')); ?>
@ -15,4 +18,6 @@ if ($product->has_attributes() || $product->has_dimensions() || $product->has_we
<?php $product->list_attributes(); ?>
</div>
<?php endif; ?>
<?php
}
?>

View File

@ -1,10 +1,10 @@
<?php global $product;
if ( get_option('woocommerce_enable_dimension_product_attributes') == 'yes' ) {
if ( $product->has_attributes() || $product->has_dimensions() || $product->has_weight() ) {
?>
<li><a href="#tab-attributes"><?php _e('Additional Information', 'woocommerce'); ?></a></li>
<?php
}
$show_attr = ( get_option( 'woocommerce_enable_dimension_product_attributes' ) == 'yes' ? true : false );
if ( $product->has_attributes() || ( $show_attr && $product->has_dimensions() ) || ( $show_attr && $product->has_weight() ) ) {
?>
<li><a href="#tab-attributes"><?php _e('Additional Information', 'woocommerce'); ?></a></li>
<?php
}
?>