Remove # (hash) from get_order_number and add to strings instead as needed.

Most places use Order #X
Some places use Order Number: X

Both are now valid.

Fixes #6518
This commit is contained in:
Mike Jolley 2014-10-24 14:53:40 +01:00
parent ef9c9b69a0
commit 2b8be95360
19 changed files with 29 additions and 29 deletions

View File

@ -882,7 +882,7 @@ abstract class WC_Abstract_Order {
* @return string
*/
public function get_order_number() {
return apply_filters( 'woocommerce_order_number', _x( '#', 'hash before order number', 'woocommerce' ) . $this->id, $this );
return apply_filters( 'woocommerce_order_number', $this->id, $this );
}
/**

View File

@ -588,7 +588,7 @@ class WC_Admin_Post_Types {
}
}
printf( __( '%s by %s', 'woocommerce' ), '<a href="' . admin_url( 'post.php?post=' . absint( $post->ID ) . '&action=edit' ) . '"><strong>' . esc_attr( $the_order->get_order_number() ) . '</strong></a>', $username );
printf( _x( '%s by %s', 'Order number by X', 'woocommerce' ), '<a href="' . admin_url( 'post.php?post=' . absint( $post->ID ) . '&action=edit' ) . '"><strong>#' . esc_attr( $the_order->get_order_number() ) . '</strong></a>', $username );
if ( $the_order->billing_email ) {
echo '<small class="meta email"><a href="' . esc_url( 'mailto:' . $the_order->billing_email ) . '">' . esc_html( $the_order->billing_email ) . '</a></small>';

View File

@ -157,7 +157,7 @@ class WC_Meta_Box_Order_Data {
<input name="post_status" type="hidden" value="<?php echo esc_attr( $order->get_status() ); ?>" />
<div id="order_data" class="panel">
<h2><?php printf( __( 'Order %s details', 'woocommerce' ), esc_html( $order->get_order_number() ) ); ?></h2>
<h2><?php printf( __( 'Order #%s Details', 'woocommerce' ), esc_html( $order->get_order_number() ) ); ?></h2>
<p class="order_number"><?php
if ( $payment_method ) {

View File

@ -182,7 +182,7 @@ class WC_Report_Customer_List extends WP_List_Table {
if ( $order_ids ) {
$order = wc_get_order( $order_ids[0] );
echo '<a href="' . admin_url( 'post.php?post=' . $order->id . '&action=edit' ) . '">' . $order->get_order_number() . '</a> &ndash; ' . date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) );
echo '<a href="' . admin_url( 'post.php?post=' . $order->id . '&action=edit' ) . '">#' . $order->get_order_number() . '</a> &ndash; ' . date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) );
} else echo '-';
break;

View File

@ -357,7 +357,7 @@ class WC_Emails {
}
$subject = sprintf( '[%s] %s', $this->get_blogname(), __( 'Product Backorder', 'woocommerce' ) );
$message = sprintf( __( '%s units of %s have been backordered in order %s.', 'woocommerce' ), $quantity, html_entity_decode( strip_tags( $product->get_formatted_name() ) ), $order->get_order_number() );
$message = sprintf( __( '%s units of %s have been backordered in order #%s.', 'woocommerce' ), $quantity, html_entity_decode( strip_tags( $product->get_formatted_name() ) ), $order->get_order_number() );
wp_mail(
apply_filters( 'woocommerce_email_recipient_backorder', get_option( 'woocommerce_stock_email_recipient' ), $args ),

View File

@ -180,7 +180,7 @@ class WC_Gateway_Mijireh extends WC_Payment_Gateway {
}
}
$mj_order->add_item( sprintf( __( 'Order %s' , 'woocommerce'), $wc_order->get_order_number() ) . " - " . implode( ', ', $item_names ), number_format( $wc_order->get_total() - round( $wc_order->get_total_shipping() + $wc_order->get_shipping_tax(), 2 ) + $wc_order->get_order_discount(), 2, '.', '' ), 1 );
$mj_order->add_item( sprintf( __( 'Order #%s' , 'woocommerce'), $wc_order->get_order_number() ) . " - " . implode( ', ', $item_names ), number_format( $wc_order->get_total() - round( $wc_order->get_total_shipping() + $wc_order->get_shipping_tax(), 2 ) + $wc_order->get_order_discount(), 2, '.', '' ), 1 );
if ( ( $wc_order->get_total_shipping() + $wc_order->get_shipping_tax() ) > 0 ) {
$mj_order->shipping = number_format( $wc_order->get_total_shipping() + $wc_order->get_shipping_tax(), 2, '.', '' );

View File

@ -358,7 +358,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$order_id = $order->id;
if ( 'yes' == $this->debug ) {
$this->log->add( 'paypal', 'Generating payment form for order ' . $order->get_order_number() . '. Notify URL: ' . $this->notify_url );
$this->log->add( 'paypal', 'Generating payment form for order #' . $order->get_order_number() . '. Notify URL: ' . $this->notify_url );
}
if ( in_array( $order->billing_country, array( 'US','CA' ) ) ) {
@ -395,7 +395,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
'bn' => 'WooThemes_Cart',
// Order key + ID
'invoice' => $this->invoice_prefix . ltrim( $order->get_order_number(), '#' ),
'invoice' => $this->invoice_prefix . $order->get_order_number(),
'custom' => serialize( array( $order_id, $order->order_key ) ),
// IPN
@ -451,7 +451,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
}
$paypal_args['item_name_1'] = $this->paypal_item_name( sprintf( __( 'Order %s' , 'woocommerce'), $order->get_order_number() ) . " - " . implode( ', ', $item_names ) );
$paypal_args['item_name_1'] = $this->paypal_item_name( sprintf( __( 'Order #%s' , 'woocommerce'), $order->get_order_number() ) . " - " . implode( ', ', $item_names ) );
$paypal_args['quantity_1'] = '1';
$paypal_args['amount_1'] = number_format( $order->get_total() - round( $order->get_total_shipping() + $order->get_shipping_tax(), 2 ) + $order->get_order_discount(), 2, '.', '' );
@ -861,7 +861,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$order->update_status( 'refunded', sprintf( __( 'Payment %s via IPN.', 'woocommerce' ), strtolower( $posted['payment_status'] ) ) );
$this->send_ipn_email_notification(
sprintf( __( 'Payment for order %s refunded/reversed', 'woocommerce' ), $order->get_order_number() ),
sprintf( __( 'Payment for order #%s refunded/reversed', 'woocommerce' ), $order->get_order_number() ),
sprintf( __( 'Order %s has been marked as refunded - PayPal reason code: %s', 'woocommerce' ), $order->get_order_number(), $posted['reason_code'] )
);
}
@ -873,15 +873,15 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$order->update_status( 'on-hold', sprintf( __( 'Payment %s via IPN.', 'woocommerce' ), strtolower( $posted['payment_status'] ) ) );
$this->send_ipn_email_notification(
sprintf( __( 'Payment for order %s reversed', 'woocommerce' ), $order->get_order_number() ),
sprintf( __( 'Payment for order #%s reversed', 'woocommerce' ), $order->get_order_number() ),
sprintf(__( 'Order %s has been marked on-hold due to a reversal - PayPal reason code: %s', 'woocommerce' ), $order->get_order_number(), $posted['reason_code'] )
);
break;
case 'canceled_reversal' :
$this->send_ipn_email_notification(
sprintf( __( 'Reversal cancelled for order %s', 'woocommerce' ), $order->get_order_number() ),
sprintf( __( 'Order %s has had a reversal cancelled. Please check the status of payment and update the order status accordingly.', 'woocommerce' ), $order->get_order_number() )
sprintf( __( 'Reversal cancelled for order #%s', 'woocommerce' ), $order->get_order_number() ),
sprintf( __( 'Order #%s has had a reversal cancelled. Please check the status of payment and update the order status accordingly.', 'woocommerce' ), $order->get_order_number() )
);
break;
default :

View File

@ -223,7 +223,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
public function process_subscription_payment( $order = '', $amount = 0 ) {
$order_items = $order->get_items();
$order_item = array_shift( $order_items );
$subscription_name = sprintf( __( '%s - Subscription for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order %s)', 'woocommerce' ), $order->get_order_number() );
$subscription_name = sprintf( __( '%s - Subscription for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order #%s)', 'woocommerce' ), $order->get_order_number() );
if ( $amount * 100 < 50 ) {
return new WP_Error( 'simplify_error', __( 'Sorry, the minimum allowed order total is 0.50 to use this payment method.', 'woocommerce' ) );
@ -326,7 +326,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
try {
$order_items = $order->get_items();
$order_item = array_shift( $order_items );
$pre_order_name = sprintf( __( '%s - Pre-order for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order %s)', 'woocommerce' ), $order->get_order_number() );
$pre_order_name = sprintf( __( '%s - Pre-order for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order #%s)', 'woocommerce' ), $order->get_order_number() );
$customer_id = get_post_meta( $order->id, '_simplify_customer_id', true );

View File

@ -287,7 +287,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
$payment = Simplify_Payment::createPayment( array(
'amount' => $order->order_total * 100, // In cents
'token' => $token,
'description' => sprintf( __( '%s - Order %s', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order->get_order_number() ),
'description' => sprintf( __( '%s - Order #%s', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order->get_order_number() ),
'currency' => strtoupper( get_woocommerce_currency() ),
'reference' => $order->id,
'card.addressCity' => $order->billing_city,

View File

@ -128,7 +128,7 @@ class WC_Shortcode_Checkout {
?>
<ul class="order_details">
<li class="order">
<?php _e( 'Order:', 'woocommerce' ); ?>
<?php _e( 'Order Number:', 'woocommerce' ); ?>
<strong><?php echo $order->get_order_number(); ?></strong>
</li>
<li class="date">
@ -141,7 +141,7 @@ class WC_Shortcode_Checkout {
</li>
<?php if ($order->payment_method_title) : ?>
<li class="method">
<?php _e( 'Payment method:', 'woocommerce' ); ?>
<?php _e( 'Payment Method:', 'woocommerce' ); ?>
<strong><?php
echo $order->payment_method_title;
?></strong>

View File

@ -37,7 +37,7 @@ if ( $order ) : ?>
<ul class="order_details">
<li class="order">
<?php _e( 'Order:', 'woocommerce' ); ?>
<?php _e( 'Order Number:', 'woocommerce' ); ?>
<strong><?php echo $order->get_order_number(); ?></strong>
</li>
<li class="date">
@ -50,7 +50,7 @@ if ( $order ) : ?>
</li>
<?php if ( $order->payment_method_title ) : ?>
<li class="method">
<?php _e( 'Payment method:', 'woocommerce' ); ?>
<?php _e( 'Payment Method:', 'woocommerce' ); ?>
<strong><?php echo $order->payment_method_title; ?></strong>
</li>
<?php endif; ?>

View File

@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_email_before_order_table', $order, true, false ); ?>
<h2><a href="<?php echo admin_url( 'post.php?post=' . $order->id . '&action=edit' ); ?>"><?php printf( __( 'Order: %s', 'woocommerce'), $order->get_order_number() ); ?></a> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
<h2><a href="<?php echo admin_url( 'post.php?post=' . $order->id . '&action=edit' ); ?>"><?php printf( __( 'Order #%s', 'woocommerce'), $order->get_order_number() ); ?></a> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<thead>

View File

@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>
<h2><?php echo __( 'Order:', 'woocommerce' ) . ' ' . $order->get_order_number(); ?></h2>
<h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<thead>

View File

@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>
<h2><?php echo __( 'Order:', 'woocommerce' ) . ' ' . $order->get_order_number(); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
<h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<thead>

View File

@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>
<h2><?php echo __( 'Order:', 'woocommerce' ) . ' ' . $order->get_order_number(); ?></h2>
<h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<thead>

View File

@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text ); ?>
<h2><?php echo __( 'Order:', 'woocommerce' ) . ' ' . $order->get_order_number(); ?></h2>
<h2><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?></h2>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<thead>

View File

@ -44,9 +44,9 @@ if ( $customer_orders ) : ?>
$item_count = $order->get_item_count();
?><tr class="order">
<td class="order-number" data-title="<?php _e( 'Order', 'woocommerce' ); ?>">
<td class="order-number" data-title="<?php _e( 'Order Number', 'woocommerce' ); ?>">
<a href="<?php echo $order->get_view_order_url(); ?>">
<?php echo $order->get_order_number(); ?>
#<?php echo $order->get_order_number(); ?>
</a>
</td>
<td class="order-date" data-title="<?php _e( 'Date', 'woocommerce' ); ?>">

View File

@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php wc_print_notices(); ?>
<p class="order-info"><?php printf( __( 'Order <mark class="order-number">%s</mark> was placed on <mark class="order-date">%s</mark> and is currently <mark class="order-status">%s</mark>.', 'woocommerce' ), $order->get_order_number(), date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ), wc_get_order_status_name( $order->get_status() ) ); ?></p>
<p class="order-info"><?php printf( __( 'Order #<mark class="order-number">%s</mark> was placed on <mark class="order-date">%s</mark> and is currently <mark class="order-status">%s</mark>.', 'woocommerce' ), $order->get_order_number(), date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ), wc_get_order_status_name( $order->get_status() ) ); ?></p>
<?php if ( $notes = $order->get_customer_order_notes() ) :
?>

View File

@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
$order_status_text = sprintf( __( 'Order %s which was made %s has the status &ldquo;%s&rdquo;', 'woocommerce' ), $order->get_order_number(), human_time_diff( strtotime( $order->order_date ), current_time( 'timestamp' ) ) . ' ' . __( 'ago', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) );
$order_status_text = sprintf( __( 'Order #%s which was made %s has the status &ldquo;%s&rdquo;', 'woocommerce' ), $order->get_order_number(), human_time_diff( strtotime( $order->order_date ), current_time( 'timestamp' ) ) . ' ' . __( 'ago', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) );
if ( $order->has_status( 'completed' ) ) $order_status_text .= ' ' . __( 'and was completed', 'woocommerce' ) . ' ' . human_time_diff( strtotime( $order->completed_date ), current_time( 'timestamp' ) ) . __( ' ago', 'woocommerce' );