Merge pull request #611 from pixeltrix/add-style-hooks-to-my-orders-table
Add classes to My Orders table so table can be styled easier
This commit is contained in:
commit
7b375a851c
|
@ -39,11 +39,11 @@ if ($customer_orders) :
|
|||
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="nobr"><?php _e('#', 'woocommerce'); ?></span></th>
|
||||
<th><span class="nobr"><?php _e('Date', 'woocommerce'); ?></span></th>
|
||||
<th><span class="nobr"><?php _e('Ship to', 'woocommerce'); ?></span></th>
|
||||
<th><span class="nobr"><?php _e('Total', 'woocommerce'); ?></span></th>
|
||||
<th colspan="2"><span class="nobr"><?php _e('Status', 'woocommerce'); ?></span></th>
|
||||
<th class="order-number"><span class="nobr"><?php _e('#', 'woocommerce'); ?></span></th>
|
||||
<th class="order-date"><span class="nobr"><?php _e('Date', 'woocommerce'); ?></span></th>
|
||||
<th class="order-shipto"><span class="nobr"><?php _e('Ship to', 'woocommerce'); ?></span></th>
|
||||
<th class="order-total"><span class="nobr"><?php _e('Total', 'woocommerce'); ?></span></th>
|
||||
<th class="order-status" colspan="2"><span class="nobr"><?php _e('Status', 'woocommerce'); ?></span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
@ -52,15 +52,15 @@ if ($customer_orders) :
|
|||
$order = new WC_Order();
|
||||
$order->populate($customer_order);
|
||||
?><tr class="order">
|
||||
<td><?php echo $order->id; ?></td>
|
||||
<td><time title="<?php echo esc_attr( strtotime($order->order_date) ); ?>"><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></time></td>
|
||||
<td><address><?php if ($order->get_formatted_shipping_address()) echo $order->get_formatted_shipping_address(); else echo '–'; ?></address></td>
|
||||
<td><?php echo woocommerce_price($order->order_total); ?></td>
|
||||
<td><?php
|
||||
<td class="order-number"><?php echo $order->id; ?></td>
|
||||
<td class="order-date"><time title="<?php echo esc_attr( strtotime($order->order_date) ); ?>"><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></time></td>
|
||||
<td class="order-shipto"><address><?php if ($order->get_formatted_shipping_address()) echo $order->get_formatted_shipping_address(); else echo '–'; ?></address></td>
|
||||
<td class="order-total"><?php echo woocommerce_price($order->order_total); ?></td>
|
||||
<td class="order-status"><?php
|
||||
$status = get_term_by('slug', $order->status, 'shop_order_status');
|
||||
echo __($status->name, 'woocommerce');
|
||||
?></td>
|
||||
<td style="text-align:right; white-space:nowrap;">
|
||||
<td class="order-actions" style="text-align:right; white-space:nowrap;">
|
||||
<?php if (in_array($order->status, array('pending', 'failed'))) : ?>
|
||||
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e('Pay', 'woocommerce'); ?></a>
|
||||
<a href="<?php echo esc_url( $order->get_cancel_order_url() ); ?>" class="button cancel"><?php _e('Cancel', 'woocommerce'); ?></a>
|
||||
|
|
|
@ -8,12 +8,12 @@ global $woocommerce;
|
|||
$order = new WC_Order( $order_id );
|
||||
?>
|
||||
<h2><?php _e('Order Details', 'woocommerce'); ?></h2>
|
||||
<table class="shop_table">
|
||||
<table class="shop_table order_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e('Product', 'woocommerce'); ?></th>
|
||||
<th><?php _e('Qty', 'woocommerce'); ?></th>
|
||||
<th><?php _e('Totals', 'woocommerce'); ?></th>
|
||||
<th class="product-name"><?php _e('Product', 'woocommerce'); ?></th>
|
||||
<th class="product-quantity"><?php _e('Qty', 'woocommerce'); ?></th>
|
||||
<th class="product-total"><?php _e('Totals', 'woocommerce'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
|
@ -53,7 +53,7 @@ $order = new WC_Order( $order_id );
|
|||
|
||||
endif;
|
||||
|
||||
echo '</td><td>'.$item['qty'].'</td><td>' . $order->get_formatted_line_subtotal($item) . '</td></tr>';
|
||||
echo '</td><td class="product-quantity">'.$item['qty'].'</td><td class="product-total">' . $order->get_formatted_line_subtotal($item) . '</td></tr>';
|
||||
|
||||
endforeach;
|
||||
endif;
|
||||
|
@ -64,7 +64,7 @@ $order = new WC_Order( $order_id );
|
|||
<header>
|
||||
<h2><?php _e('Customer details', 'woocommerce'); ?></h2>
|
||||
</header>
|
||||
<dl>
|
||||
<dl class="customer_details">
|
||||
<?php
|
||||
if ($order->billing_email) echo '<dt>'.__('Email:', 'woocommerce').'</dt><dd>'.$order->billing_email.'</dd>';
|
||||
if ($order->billing_phone) echo '<dt>'.__('Telephone:', 'woocommerce').'</dt><dd>'.$order->billing_phone.'</dd>';
|
||||
|
|
Loading…
Reference in New Issue