Order data/fixed keys. Closes #1981.

This commit is contained in:
Mike Jolley 2012-12-13 00:47:40 +00:00
parent 3af034755b
commit 7976ae8a66
5 changed files with 129 additions and 105 deletions

View File

@ -49,16 +49,29 @@ function woocommerce_order_data_meta_box($post) {
$order_title = $post->post_title; $order_title = $post->post_title;
?> ?>
<style type="text/css"> <style type="text/css">
#titlediv, #major-publishing-actions, #minor-publishing-actions, #visibility, #submitdiv { display:none } #post-body-content, #titlediv, #major-publishing-actions, #minor-publishing-actions, #visibility, #submitdiv { display:none }
</style> </style>
<div class="panel-wrap woocommerce"> <div class="panel-wrap woocommerce">
<input name="post_title" type="hidden" value="<?php echo esc_attr( $order_title ); ?>" /> <input name="post_title" type="hidden" value="<?php echo esc_attr( $order_title ); ?>" />
<input name="post_status" type="hidden" value="publish" /> <input name="post_status" type="hidden" value="publish" />
<div id="order_data" class="panel"> <div id="order_data" class="panel">
<div class="order_data_left"> <h2><?php _e( 'Order Details', 'woocommerce' ); ?></h2>
<p class="order_number"><?php
<h2><?php _e( 'Order Details', 'woocommerce' ); ?> &mdash; <?php echo esc_html( $order->get_order_number() ); ?></h2> echo __( 'Order number', 'woocommerce' ) . ' ' . esc_html( $order->get_order_number() ) . '. ';
$ip_address = get_post_meta( $post->ID, '_customer_ip_address', true );
if ( $ip_address )
echo __( 'Customer IP:', 'woocommerce' ) . ' ' . esc_html( $ip_address );
?></p>
<div class="order_data_column_container">
<div class="order_data_column">
<h4><?php _e( 'General Details', 'woocommerce' ); ?></h4>
<p class="form-field"><label for="order_status"><?php _e( 'Order status:', 'woocommerce' ) ?></label> <p class="form-field"><label for="order_status"><?php _e( 'Order status:', 'woocommerce' ) ?></label>
<select id="order_status" name="order_status" class="chosen_select"> <select id="order_status" name="order_status" class="chosen_select">
@ -110,21 +123,21 @@ function woocommerce_order_data_meta_box($post) {
return terms; return terms;
}); });
" ); " );
?> ?>
</p> </p>
<?php if ( get_option( 'woocommerce_enable_order_comments' ) != 'no' ) : ?> <?php if ( get_option( 'woocommerce_enable_order_comments' ) != 'no' ) : ?>
<p class="form-field form-field-wide"><label for="excerpt"><?php _e( 'Customer Note:', 'woocommerce' ) ?></label> <p class="form-field form-field-wide"><label for="excerpt"><?php _e( 'Customer Note:', 'woocommerce' ) ?></label>
<textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php _e( 'Customer\'s notes about the order', 'woocommerce' ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p> <textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php _e( 'Customer\'s notes about the order', 'woocommerce' ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p>
<?php endif; ?> <?php endif; ?>
<?php do_action( 'woocommerce_admin_order_data_after_order_details', $order ); ?> <?php do_action( 'woocommerce_admin_order_data_after_order_details', $order ); ?>
</div> </div>
<div class="order_data_right"> <div class="order_data_column">
<div class="order_data"> <h4><?php _e( 'Billing Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h4>
<h2><?php _e( 'Billing Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h2>
<?php <?php
$billing_data = apply_filters('woocommerce_admin_billing_fields', array( $billing_data = apply_filters('woocommerce_admin_billing_fields', array(
'first_name' => array( 'first_name' => array(
@ -182,7 +195,7 @@ function woocommerce_order_data_meta_box($post) {
echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No billing address set.', 'woocommerce' ) . '</p>'; echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No billing address set.', 'woocommerce' ) . '</p>';
foreach ( $billing_data as $key => $field ) { foreach ( $billing_data as $key => $field ) {
if ( empty( $field['show'] ) ) if ( isset( $field['show'] ) && $field['show'] === false )
continue; continue;
$field_name = 'billing_' . $key; $field_name = 'billing_' . $key;
if ( $order->$field_name ) if ( $order->$field_name )
@ -212,9 +225,9 @@ function woocommerce_order_data_meta_box($post) {
do_action( 'woocommerce_admin_order_data_after_billing_address', $order ); do_action( 'woocommerce_admin_order_data_after_billing_address', $order );
?> ?>
</div> </div>
<div class="order_data order_data_alt"> <div class="order_data_column">
<h2><?php _e( 'Shipping Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h2> <h4><?php _e( 'Shipping Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h4>
<?php <?php
$shipping_data = apply_filters('woocommerce_admin_shipping_fields', array( $shipping_data = apply_filters('woocommerce_admin_shipping_fields', array(
'first_name' => array( 'first_name' => array(
@ -266,7 +279,7 @@ function woocommerce_order_data_meta_box($post) {
echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No shipping address set.', 'woocommerce' ) . '</p>'; echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No shipping address set.', 'woocommerce' ) . '</p>';
if ( $shipping_data ) foreach ( $shipping_data as $key => $field ) { if ( $shipping_data ) foreach ( $shipping_data as $key => $field ) {
if ( empty( $field['show'] ) ) if ( isset( $field['show'] ) && $field['show'] === false )
continue; continue;
$field_name = 'shipping_' . $key; $field_name = 'shipping_' . $key;
if ( $order->$field_name ) if ( $order->$field_name )

File diff suppressed because one or more lines are too long

View File

@ -446,14 +446,48 @@ ul.wc_coupon_list_block {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
#woocommerce-order-data {
h3.hndle, .handlediv {
display: none;
}
.inside {
display: block !important;
}
}
#order_data { #order_data {
padding: 0 10px 9px; padding: 23px 24px 12px 24px;
.order_data_left {
width: 48%;
float: left;
h2 { h2 {
margin-top: 11px; margin: 0;
margin-bottom: 0; font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
font-size: 21px;
font-weight: normal;
line-height: 1.2;
text-shadow: 1px 1px 1px white;
padding: 0;
}
h4 {
color: #333;
margin: 1.33em 0 0;
}
p {
color: #777;
}
p.order_number {
margin: 0;
font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
font-weight: normal;
line-height: 1.6em;
font-size: 16px;
}
.order_data_column_container {
clear: both;
}
.order_data_column {
width: 32%;
padding: 0 2% 0 0;
float: left;
&:last-child {
padding-right: 0;
} }
p { p {
padding: 0 !important; padding: 0 !important;
@ -487,6 +521,11 @@ ul.wc_coupon_list_block {
.hour, .minute { .hour, .minute {
width: 2.5em; width: 2.5em;
} }
small {
display: block;
margin: 5px 0 0 0;
color: #999;
}
} }
.form-field.last { .form-field.last {
float: right; float: right;
@ -501,48 +540,20 @@ ul.wc_coupon_list_block {
width: 100%; width: 100%;
} }
} }
}
.order_data_right {
width: 48%;
float: right;
.order_data {
overflow: hidden;
zoom: 1;
width: 49%;
float:left;
}
.order_data_alt {
float:right;
}
h2 {
margin-top: 11px;
margin-bottom: 0;
}
p {
padding: 0 !important;
}
p.none_set { p.none_set {
color: #999; color: #999;
} }
.form-field { ._billing_first_name_field, ._billing_address_1_field, ._billing_city_field, ._billing_country_field, ._billing_email_field,
._shipping_first_name_field, ._shipping_address_1_field, ._shipping_city_field, ._shipping_country_field {
float: left; float: left;
width: 50%;
padding: 0;
margin: 9px 0 0 0;
label {
display: block;
padding: 0 0 3px;
}
input, select {
width: 95%;
} }
._billing_last_name_field, ._billing_address_2_field, ._billing_postcode_field, ._billing_state_field, ._billing_phone_field,
._shipping_last_name_field, ._shipping_address_2_field, ._shipping_postcode_field, ._shipping_state_field {
float: right;
} }
._billing_company_field, ._shipping_company_field { ._billing_company_field, ._shipping_company_field {
clear: both; clear: both;
width: 100%; width: 100%;
input {
width: 97.5%;
}
} }
._billing_email_field { ._billing_email_field {
clear: left clear: left
@ -551,6 +562,7 @@ ul.wc_coupon_list_block {
display: none; display: none;
overflow: hidden; overflow: hidden;
zoom: 1; zoom: 1;
padding-right: 1px;
} }
} }
} }

View File

@ -171,10 +171,9 @@ jQuery( function($){
}); });
$('a.edit_address').click(function(event){ $('a.edit_address').click(function(event){
$(this).hide(); $(this).hide();
$(this).closest('.order_data').find('div.address').hide(); $(this).closest('.order_data_column').find('div.address').hide();
$(this).closest('.order_data').find('div.edit_address').show(); $(this).closest('.order_data_column').find('div.edit_address').show();
event.preventDefault(); event.preventDefault();
}); });

File diff suppressed because one or more lines are too long