shortcode_wrapper('woocommerce_order_tracking', $atts); } function woocommerce_order_tracking( $atts ) { global $woocommerce; extract(shortcode_atts(array( ), $atts)); global $post; if ($_POST) : $order = &new woocommerce_order(); if (isset($_POST['orderid']) && $_POST['orderid'] > 0) $order->id = (int) $_POST['orderid']; else $order->id = 0; if (isset($_POST['order_email']) && $_POST['order_email']) $order_email = trim($_POST['order_email']); else $order_email = ''; if ( !$woocommerce->verify_nonce('order_tracking') ): echo '
'.__('You have taken too long. Please refresh the page and retry.', 'woothemes').'
'; elseif ($order->id && $order_email && $order->get_order( $order->id )) : if ($order->billing_email == $order_email) : $status = get_term_by('slug', $order->status, 'shop_order_status'); $order_status_text = sprintf( __('Order #%s which was made %s has the status “%s”', 'woothemes'), $order->id, human_time_diff(strtotime($order->order_date), current_time('timestamp')).__(' ago', 'woothemes'), __($status->name, 'woothemes') ); if ($order->status == 'completed') $order_status_text .= ' ' . __('and was completed', 'woothemes') . ' ' . human_time_diff(strtotime($order->completed_date), current_time('timestamp')).__(' ago', 'woothemes'); $order_status_text .= '.'; echo wpautop(apply_filters('woocommerce_order_tracking_status', $order_status_text, $order)); ?> get_customer_order_notes(); if ($notes) : ?>billing_first_name.' '.$order->billing_last_name.'
';
if ($order->billing_company) $address .= $order->billing_company.'
';
$address .= $order->formatted_billing_address;
echo $address;
?>
shipping_first_name.' '.$order->shipping_last_name.'
';
if ($order->shipping_company) $address .= $order->shipping_company.'
';
$address .= $order->formatted_shipping_address;
echo $address;
?>
'.sprintf(__('Sorry, we could not find that order id in our database. Want to retry?', 'woothemes'), get_permalink($post->ID)).'
'; endif; else : ?>
comment_date)); ?>