Don't show price when variation prices don't differ. Closes #1199.
This commit is contained in:
parent
ea60024453
commit
880e8b6b0f
File diff suppressed because one or more lines are too long
|
@ -116,7 +116,7 @@ div.product, #content div.product {
|
|||
}
|
||||
|
||||
/* Price */
|
||||
p.price {
|
||||
span.price, p.price {
|
||||
color: @highlight;
|
||||
font-size: 1.25em;
|
||||
ins {
|
||||
|
@ -311,7 +311,6 @@ div.product, #content div.product {
|
|||
div.quantity {
|
||||
float:none;
|
||||
margin: 0;
|
||||
width: 72px;
|
||||
}
|
||||
small.stock {
|
||||
display:block;
|
||||
|
@ -319,18 +318,35 @@ div.product, #content div.product {
|
|||
}
|
||||
}
|
||||
.variations {
|
||||
margin-bottom: 1em;
|
||||
label {
|
||||
font-weight:bold;
|
||||
font-weight: bold;
|
||||
}
|
||||
select {
|
||||
width: 100%;
|
||||
float:left;
|
||||
}
|
||||
td.label {
|
||||
padding-right: 1em;
|
||||
}
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
.button {
|
||||
vertical-align: middle;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.group_table {
|
||||
td.label {
|
||||
padding-right: 1em;
|
||||
padding-left: 1em;
|
||||
}
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -622,7 +622,7 @@ class WC_Product {
|
|||
|
||||
else :
|
||||
|
||||
if ( !$this->min_variation_price || $this->min_variation_price !== $this->max_variation_price )
|
||||
if ( ! $this->min_variation_price || $this->min_variation_price !== $this->max_variation_price )
|
||||
$price .= $this->get_price_html_from_text();
|
||||
|
||||
$price .= woocommerce_price( $this->get_price() );
|
||||
|
@ -647,7 +647,7 @@ class WC_Product {
|
|||
|
||||
else :
|
||||
|
||||
if ( !$this->min_variation_price || $this->min_variation_price !== $this->max_variation_price )
|
||||
if ( ! $this->min_variation_price || $this->min_variation_price !== $this->max_variation_price )
|
||||
$price .= $this->get_price_html_from_text();
|
||||
|
||||
$price .= __('Free!', 'woocommerce');
|
||||
|
@ -1071,7 +1071,7 @@ class WC_Product {
|
|||
'attributes' => $variation_attributes,
|
||||
'image_src' => $image,
|
||||
'image_link' => $image_link,
|
||||
'price_html' => '<span class="price">' . $variation->get_price_html() . '</span>',
|
||||
'price_html' => $this->min_variation_price != $this->max_variation_price ? '<span class="price">' . $variation->get_price_html() . '</span>' : '',
|
||||
'availability_html' => $availability_html,
|
||||
'sku' => __( 'SKU:', 'woocommerce' ) . ' ' . $variation->get_sku(),
|
||||
'min_qty' => 1,
|
||||
|
|
|
@ -49,7 +49,7 @@ foreach ( $product->get_children() as $child_id ) {
|
|||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
<td><label for="product-<?php echo $child_product['product']->id; ?>"><?php
|
||||
<td class="label"><label for="product-<?php echo $child_product['product']->id; ?>"><?php
|
||||
|
||||
if ($child_product['product']->is_visible())
|
||||
echo '<a href="'.get_permalink($child_product['product']->id).'">' . $child_product['product']->get_title() . '</a>';
|
||||
|
|
|
@ -16,8 +16,8 @@ global $woocommerce, $product, $post;
|
|||
<tbody>
|
||||
<?php $loop = 0; foreach ( $attributes as $name => $options ) : $loop++; ?>
|
||||
<tr>
|
||||
<td><label for="<?php echo sanitize_title($name); ?>"><?php echo $woocommerce->attribute_label($name); ?></label></td>
|
||||
<td><select id="<?php echo esc_attr( sanitize_title($name) ); ?>" name="attribute_<?php echo sanitize_title($name); ?>">
|
||||
<td class="label"><label for="<?php echo sanitize_title($name); ?>"><?php echo $woocommerce->attribute_label($name); ?></label></td>
|
||||
<td class="value"><select id="<?php echo esc_attr( sanitize_title($name) ); ?>" name="attribute_<?php echo sanitize_title($name); ?>">
|
||||
<option value=""><?php echo __('Choose an option', 'woocommerce') ?>…</option>
|
||||
<?php
|
||||
if ( is_array( $options ) ) {
|
||||
|
|
Loading…
Reference in New Issue