Some minor improvements in the custom orders table implmentation.
This commit is contained in:
parent
746d6a99b1
commit
71cc725bb5
|
@ -275,7 +275,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'info':
|
case 'info':
|
||||||
echo '<tr><th scope="row" class="titledesc"/><td style="' . esc_html( $value['css'] ) . '">';
|
echo '<tr><th scope="row" class="titledesc"/><td style="' . esc_attr( $value['css'] ) . '">';
|
||||||
echo wp_kses_post( wpautop( wptexturize( $value['text'] ) ) );
|
echo wp_kses_post( wpautop( wptexturize( $value['text'] ) ) );
|
||||||
echo '</td></tr>';
|
echo '</td></tr>';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -322,19 +322,19 @@ class CustomOrdersTableController {
|
||||||
|
|
||||||
if ( $sync_is_pending ) {
|
if ( $sync_is_pending ) {
|
||||||
$initial_pending_count = $sync_status['initial_pending_count'];
|
$initial_pending_count = $sync_status['initial_pending_count'];
|
||||||
|
$current_pending_count = $sync_status['current_pending_count'];
|
||||||
if ( $initial_pending_count ) {
|
if ( $initial_pending_count ) {
|
||||||
$text = sprintf(
|
$text =
|
||||||
|
sprintf(
|
||||||
/* translators: %1$s=current number of orders pending sync, %2$s=initial number of orders pending sync */
|
/* translators: %1$s=current number of orders pending sync, %2$s=initial number of orders pending sync */
|
||||||
__( 'There are %1$s orders (out of a total of %2$s) pending sync!', 'woocommerce' ),
|
_n( 'There\'s %1$s order (out of a total of %2$s) pending sync!', 'There are %1$s orders (out of a total of %2$s) pending sync!', $current_pending_count, 'woocommerce' ),
|
||||||
$sync_status['current_pending_count'],
|
$current_pending_count,
|
||||||
$initial_pending_count
|
$initial_pending_count
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$text = sprintf(
|
$text =
|
||||||
/* translators: %1$s=current number of orders pending sync */
|
/* translators: %s=initial number of orders pending sync */
|
||||||
__( 'There are %1$s orders pending sync!', 'woocommerce' ),
|
sprintf( _n( 'There\'s %s order pending sync!', 'There are %s orders pending sync!', $current_pending_count, 'woocommerce' ), $current_pending_count, 'woocommerce' );
|
||||||
$sync_status['current_pending_count']
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $this->data_synchronizer->pending_data_sync_is_in_progress() ) {
|
if ( $this->data_synchronizer->pending_data_sync_is_in_progress() ) {
|
||||||
|
|
|
@ -159,12 +159,10 @@ class DataSynchronizer {
|
||||||
$missing_orders_count_sql = "SELECT COUNT(1) FROM $orders_table WHERE post_id IS NULL";
|
$missing_orders_count_sql = "SELECT COUNT(1) FROM $orders_table WHERE post_id IS NULL";
|
||||||
} else {
|
} else {
|
||||||
$missing_orders_count_sql = "
|
$missing_orders_count_sql = "
|
||||||
SELECT COUNT(1) FROM (
|
SELECT COUNT( posts.ID ) FROM $wpdb->posts posts
|
||||||
SELECT posts.ID,orders.post_id FROM $wpdb->posts posts
|
|
||||||
LEFT JOIN $orders_table orders ON posts.ID = orders.post_id
|
LEFT JOIN $orders_table orders ON posts.ID = orders.post_id
|
||||||
WHERE posts.post_type='shop_order' AND orders.post_id IS NULL
|
WHERE posts.post_type='shop_order' AND orders.post_id IS NULL
|
||||||
AND posts.post_status != 'auto-draft'
|
AND posts.post_status != 'auto-draft'";
|
||||||
) x";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
|
|
Loading…
Reference in New Issue