newlines and styling tweak. Closes #1112.

This commit is contained in:
Mike Jolley 2012-06-10 18:45:43 +01:00
parent f9f1bb9ddd
commit 4d7d184698
7 changed files with 18 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@ -860,7 +860,7 @@ table.my_account_orders {
td.product-name {
dl.variation {
margin: 0;
margin: .25em 0 .5em;
font-size: 0.8751em;
dt {
font-weight:bold;
@ -870,7 +870,7 @@ td.product-name {
padding: 0;
}
dd {
margin-bottom: 0;
margin: 0 0 .25em 0;
}
}
p.backorder_notification {
@ -886,6 +886,9 @@ td.product-quantity {
-------------------------------------------------------------- */
table.cart, #content table.cart {
.product-thumbnail {
min-width: 32px;
}
img {
width: 32px;
height:auto;

View File

@ -400,15 +400,15 @@ class WC_Cart {
$value = ucfirst( $value );
}
if ($flat)
if ( $flat )
$variation_list[] = $woocommerce->attribute_label( str_replace( 'attribute_', '', $name ) ) . ': ' . $value;
else
$variation_list[] = '<dt>'.$woocommerce->attribute_label( str_replace( 'attribute_', '', $name ) ) . ':</dt><dd>' . $value . '</dd>';
$variation_list[] = '<dt>' . $woocommerce->attribute_label( str_replace( 'attribute_', '', $name ) ) . ':</dt><dd>' . $value . '</dd>';
}
if ($flat)
$return .= implode( ', ', $variation_list );
$return .= implode( ", \n",, $variation_list );
else
$return .= implode( '', $variation_list );

View File

@ -928,21 +928,21 @@ class order_item_meta {
function display( $flat = false, $return = false ) {
global $woocommerce;
if ($this->meta && is_array($this->meta)) :
if ( $this->meta && is_array( $this->meta ) ) :
if (!$flat) $output = '<dl class="variation">'; else $output = '';
if ( ! $flat ) $output = '<dl class="variation">'; else $output = '';
$meta_list = array();
foreach ($this->meta as $meta) :
foreach ( $this->meta as $meta ) :
$name = $meta['meta_name'];
$value = $meta['meta_value'];
if (!$value) continue;
if ( ! $value ) continue;
// If this is a term slug, get the term's nice name
if (taxonomy_exists(esc_attr(str_replace('attribute_', '', $name)))) :
if ( taxonomy_exists( esc_attr( str_replace( 'attribute_', '', $name ) ) ) ) :
$term = get_term_by('slug', $value, esc_attr(str_replace('attribute_', '', $name)));
if (!is_wp_error($term) && $term->name) :
$value = $term->name;
@ -960,7 +960,7 @@ class order_item_meta {
endforeach;
if ($flat) :
$output .= implode(', ', $meta_list);
$output .= implode(", \n", $meta_list);
else :
$output .= implode('', $meta_list);
endif;

View File

@ -176,6 +176,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - Format phone number dots to dashes
* Tweak - Cart widget respects cart tax settings
* Tweak - Exempt from VAT shows price ex VAT
* Tweak - Newlines for order meta (flat)
* Fix - Strange error where detecting the page (is_page etc) would break the canonical redirect in some instances when hooked into 'wp'. Used the later get_header hook instead.
* Fix - Right now links.
* Fix - fix for https://bugs.php.net/bug.php?id=61166 (thanks Max Rice)

View File

@ -16,7 +16,7 @@ global $woocommerce;
<th class="product-remove">&nbsp;</th>
<th class="product-thumbnail">&nbsp;</th>
<th class="product-name"><span class="nobr"><?php _e('Product Name', 'woocommerce'); ?></span></th>
<th class="product-price"><span class="nobr"><?php _e('Unit Price', 'woocommerce'); ?></span></th>
<th class="product-price"><span class="nobr"><?php _e('Unit', 'woocommerce'); ?></span></th>
<th class="product-quantity"><?php _e('Quantity', 'woocommerce'); ?></th>
<th class="product-subtotal"><?php _e('Price', 'woocommerce'); ?></th>
</tr>

View File

@ -31,7 +31,7 @@ foreach ($items as $item) :
echo ($show_download_links && $_product->exists() && $_product->is_downloadable()) ? '<br/><small>'.__('Download:', 'woocommerce').' <a href="' . $order->get_downloadable_file_url( $item['id'], $item['variation_id'] ) . '" target="_blank">' . $order->get_downloadable_file_url( $item['id'], $item['variation_id'] ) . '</a></small>' : '';
// Variation
echo ($item_meta->meta) ? '<br/><small>' . $item_meta->display( true, true ) . '</small>' : '';
echo ($item_meta->meta) ? '<br/><small>' . nl2br( $item_meta->display( true, true ) ) . '</small>' : '';
?></td>
<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;"><?php echo $item['qty'] ;?></td>