本文整理汇总了PHP中wc_get_order_status_name函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_get_order_status_name函数的具体用法?PHP wc_get_order_status_name怎么用?PHP wc_get_order_status_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wc_get_order_status_name函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: order_data
public static function order_data($atts)
{
extract(shortcode_atts(array('meta' => ''), $atts));
if (!($order = self::get_order())) {
return;
}
$return = '';
if ($meta == 'status') {
$return = wc_get_order_status_name($order->get_status());
} else {
if ($meta == 'payment_status') {
$return = $order->paid_date ? __('paid', 'invoices', 'woocommerce-germanized-pro') : __('pending payment', 'invoices', 'woocommerce-germanized-pro');
} else {
if ($meta == 'payment_info') {
ob_start();
do_action('woocommerce_thankyou_' . $order->payment_method, $order->id);
$return = ob_get_clean();
} else {
if ($meta == "id") {
$return = $order->id;
} else {
$data = $order->{$meta};
if (!$data) {
$return = false;
} elseif (is_array($data)) {
$return = implode(', ', $data);
} else {
$return = $data;
}
}
}
}
}
return apply_filters('woocommerce_gzdp_shortcode_order_data', $return, $atts);
}
开发者ID:radscheit,项目名称:unicorn,代码行数:35,代码来源:class-wc-gzdp-invoice-shortcodes.php
示例2: init_form_fields
/**
* Initialise Gateway Settings Form Fields
*/
public function init_form_fields()
{
$this->form_fields = array('enabled' => array('title' => __('Enable/Disable', 'mollie-payments-for-woocommerce'), 'type' => 'checkbox', 'label' => sprintf(__('Enable %s', 'mollie-payments-for-woocommerce'), $this->getDefaultTitle()), 'default' => 'yes'), 'title' => array('title' => __('Title', 'mollie-payments-for-woocommerce'), 'type' => 'text', 'description' => sprintf(__('This controls the title which the user sees during checkout. Default <code>%s</code>', 'mollie-payments-for-woocommerce'), $this->getDefaultTitle()), 'default' => $this->getDefaultTitle(), 'desc_tip' => true), 'display_logo' => array('title' => __('Display logo', 'mollie-payments-for-woocommerce'), 'type' => 'checkbox', 'label' => __('Display logo on checkout page. Default <code>enabled</code>', 'mollie-payments-for-woocommerce'), 'default' => 'yes'), 'description' => array('title' => __('Description', 'mollie-payments-for-woocommerce'), 'type' => 'textarea', 'description' => sprintf(__('Payment method description that the customer will see on your checkout. Default <code>%s</code>', 'mollie-payments-for-woocommerce'), $this->getDefaultDescription()), 'default' => $this->getDefaultDescription(), 'desc_tip' => true));
if ($this->paymentConfirmationAfterCoupleOfDays()) {
$this->form_fields['initial_order_status'] = array('title' => __('Initial order status', 'mollie-payments-for-woocommerce'), 'type' => 'select', 'options' => array(self::STATUS_ON_HOLD => wc_get_order_status_name(self::STATUS_ON_HOLD) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')', self::STATUS_PENDING => wc_get_order_status_name(self::STATUS_PENDING)), 'default' => self::STATUS_ON_HOLD, 'description' => sprintf(__('Some payment methods take longer than a few hours to complete. The initial order state is then set to \'%s\'. This ensures the order is not cancelled when the setting %s is used.', 'mollie-payments-for-woocommerce'), wc_get_order_status_name(self::STATUS_ON_HOLD), '<a href="' . admin_url('admin.php?page=wc-settings&tab=products§ion=inventory') . '" target="_blank">' . __('Hold Stock (minutes)', 'woocommerce') . '</a>'));
}
}
开发者ID:vanengers,项目名称:WooCommerce,代码行数:10,代码来源:abstract.php
示例3: view_order
/**
* View order page
*
* @param int $order_id
*/
private static function view_order($order_id)
{
$user_id = get_current_user_id();
$order = wc_get_order($order_id);
if (!current_user_can('view_order', $order_id)) {
echo '<div class="woocommerce-error">' . __('Invalid order.', 'woocommerce') . ' <a href="' . wc_get_page_permalink('myaccount') . '" class="wc-forward">' . __('My Account', 'woocommerce') . '</a>' . '</div>';
return;
}
// Backwards compatibility
$status = new stdClass();
$status->name = wc_get_order_status_name($order->get_status());
wc_get_template('myaccount/view-order.php', array('status' => $status, 'order' => wc_get_order($order_id), 'order_id' => $order_id));
}
开发者ID:CannedHead,项目名称:feelingsurf,代码行数:18,代码来源:class-wc-shortcode-my-account.php
示例4: et_render_transaction_report
/**
*
*/
function et_render_transaction_report()
{
global $user_ID;
$start_date = $end_date = null;
if (isset($_POST['start_date'])) {
$start_date = $_POST['start_date'];
}
if (isset($_POST['end_date'])) {
$end_date = $_POST['end_date'];
}
$selled_orders = et_get_order_product_by_seller($user_ID, $start_date, $end_date);
$report = array();
foreach ($selled_orders as $order_id => $order) {
$date = get_the_date("Y-m-d", $order_id);
if (isset($report[$date]["salecount"])) {
$report[$date]["salecount"] += count($order);
} else {
$report[$date]["salecount"] = count($order);
}
$report[$date]["subtotal"] = array();
foreach ($order as $product_id => $product) {
if (isset($report[$date]["subtotal"][$product->status])) {
$report[$date]["subtotal"][$product->status] += $product->subtotal;
} else {
$report[$date]["subtotal"][$product->status] = $product->subtotal;
}
}
}
ob_start();
foreach ($report as $date => $data) {
echo "<tr>";
echo "<td>{$date}</td>";
echo "<td>{$data['salecount']}</td>";
echo "<td>";
foreach ($data['subtotal'] as $status => $total) {
$subtotal = wc_price($total);
$status = wc_get_order_status_name($status);
echo "{$status} : {$subtotal}<br>";
}
echo "</td>";
echo "</tr>";
}
ob_end_flush();
}
开发者ID:linniepinski,项目名称:perssistant,代码行数:47,代码来源:functions.php
示例5: wc_print_notices
wc_print_notices();
?>
<div class="order__intro">
<section id="order__intro__section">
<!-- Home header title -->
<h1 class="page__title"><?php
printf(__('Order #<mark class="order-number">%s</mark>', 'woocommerce'), $order->get_order_number());
?>
</h1>
<div class="steps__frame">
<p><?php
printf(__('Was placed on <mark class="order-date">%s</mark> and is currently <mark class="order-status">%s</mark>.', 'woocommerce'), date_i18n(get_option('date_format'), strtotime($order->order_date)), wc_get_order_status_name($order->get_status()));
?>
</p>
</div>
<div class="home__intro__section__mascotte">
</div>
</section>
</div>
<div class="order-step">
<section class="order-step__section">
开发者ID:sebastiaandekker,项目名称:sd,代码行数:31,代码来源:view-order.php
示例6: wc_print_notices
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
*/
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
?>
<?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>.', '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()) {
?>
<h2><?php
_e('Order Updates', 'woocommerce');
?>
</h2>
<ol class="commentlist notes">
<?php
foreach ($notes as $note) {
?>
<li class="comment note">
开发者ID:Carfulan-Group,项目名称:SYS-Consumables-Store,代码行数:31,代码来源:view-order.php
示例7: esc_attr
</td>
<td class="order-date">
<time datetime="<?php
echo esc_attr(date('Y-m-d', strtotime($order->order_date)));
?>
" title="<?php
echo esc_attr(strtotime($order->order_date));
?>
"><?php
echo apply_filters('esc_html', date_i18n(get_option('date_format'), strtotime($order->order_date)));
?>
</time>
</td>
<td class="order-status" style="text-align:left; white-space:nowrap;">
<?php
echo apply_filters('esc_html', wc_get_order_status_name($order->get_status()));
?>
</td>
<td class="order-total">
<?php
echo apply_filters('esc_html', sprintf(_n('%s for %s item', '%s for %s items', $item_count, 'jv_allinone'), $order->get_formatted_order_total(), $item_count));
?>
</td>
<td class="order-actions">
<?php
$actions = array();
if ($order->needs_payment()) {
$actions['pay'] = array('url' => $order->get_checkout_payment_url(), 'name' => __('Pay', 'jv_allinone'));
}
开发者ID:taeche,项目名称:SoDoEx,代码行数:31,代码来源:my-orders.php
示例8: sprintf
<?php
/**
* Order tracking
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
*/
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
$order_status_text = sprintf(__('Order #%s which was made %s has the status “%s”', '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');
}
$order_status_text .= '.';
echo "<p class='first-color'>";
echo esc_attr(apply_filters('woocommerce_order_tracking_status', $order_status_text, $order));
echo "</p>";
$notes = $order->get_customer_order_notes();
if ($notes) {
?>
<h2><?php
_e('Order Updates', 'woocommerce');
?>
</h2>
<?php
foreach ($notes as $note) {
?>
开发者ID:nickkoskowski,项目名称:Work-Depot,代码行数:31,代码来源:tracking.php
示例9: update_status
/**
* Updates status of order
*
* @param string $new_status Status to change the order to. No internal wc- prefix is required.
* @param string $note (default: '') Optional note to add
* @param bool $manual is this a manual order status change?
*/
public function update_status($new_status, $note = '', $manual = false)
{
if (!$this->id) {
return;
}
// Standardise status names.
$new_status = 'wc-' === substr($new_status, 0, 3) ? substr($new_status, 3) : $new_status;
$old_status = $this->get_status();
// Only update if they differ - and ensure post_status is a 'wc' status.
if ($new_status !== $old_status || !in_array($this->post_status, array_keys(wc_get_order_statuses()))) {
// Update the order
wp_update_post(array('ID' => $this->id, 'post_status' => 'wc-' . $new_status));
$this->post_status = 'wc-' . $new_status;
$this->add_order_note(trim($note . ' ' . sprintf(__('Order status changed from %s to %s.', 'woocommerce'), wc_get_order_status_name($old_status), wc_get_order_status_name($new_status))), 0, $manual);
// Status was changed
do_action('woocommerce_order_status_' . $new_status, $this->id);
do_action('woocommerce_order_status_' . $old_status . '_to_' . $new_status, $this->id);
do_action('woocommerce_order_status_changed', $this->id, $old_status, $new_status);
switch ($new_status) {
case 'completed':
// Record the sales
$this->record_product_sales();
// Increase coupon usage counts
$this->increase_coupon_usage_counts();
// Record the completed date of the order
update_post_meta($this->id, '_completed_date', current_time('mysql'));
// Update reports
wc_delete_shop_order_transients($this->id);
break;
case 'processing':
case 'on-hold':
// Record the sales
$this->record_product_sales();
// Increase coupon usage counts
$this->increase_coupon_usage_counts();
// Update reports
wc_delete_shop_order_transients($this->id);
break;
case 'cancelled':
// If the order is cancelled, restore used coupons
$this->decrease_coupon_usage_counts();
// Update reports
wc_delete_shop_order_transients($this->id);
break;
}
}
}
开发者ID:danisdead,项目名称:gastrointernacional,代码行数:54,代码来源:abstract-wc-order.php
示例10: order_status
/**
* Returns the order status.
*
* @todo remove safety check against existence of wc_get_order_status_name() in future release
* (exists for backward compatibility with versions of WC below 2.2)
*
* @param $order_id
* @return string
*/
protected function order_status($order_id)
{
if (!function_exists('wc_get_order_status_name')) {
return __('Unknown', 'event-tickets-plus');
}
return wc_get_order_status_name(get_post_status($order_id));
}
开发者ID:jamestrevorlees,项目名称:odd-web-v1.00,代码行数:16,代码来源:Main.php
示例11: esc_attr_e
<td class="order-status" data-title="<?php
esc_attr_e('Status', 'woocommerce-subscriptions');
?>
" style="text-align:left; white-space:nowrap;">
<?php
if ($order->get_status() == 'completed') {
?>
<span class="label label-success"><?php
echo esc_html(wc_get_order_status_name($order->get_status()));
?>
</span>
<?php
} else {
?>
<span class="label label-danger"><?php
echo esc_html(wc_get_order_status_name($order->get_status()));
?>
</span>
<?php
}
?>
</td>
<td class="order-total" data-title="<?php
esc_attr_e('Total', 'woocommerce-subscriptions');
?>
">
<?php
// translators: price for number of items
echo wp_kses_post(sprintf(_n('%s for %s item', '%s for %s items', $item_count, 'woocommerce-subscriptions'), $order->get_formatted_order_total(), $item_count));
?>
</td>
开发者ID:ltdat287,项目名称:id.nhomdichvu,代码行数:31,代码来源:related-orders.php
示例12: wc_print_notices
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
*/
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
?>
<?php
wc_print_notices();
?>
<p class="order-info"><?php
printf(esc_html__('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>.', 'kute-boutique'), $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()) {
?>
<h2><?php
esc_html_e('Order Updates', 'kute-boutique');
?>
</h2>
<ol class="commentlist notes">
<?php
foreach ($notes as $note) {
?>
<li class="comment note">
开发者ID:TruongTuyen,项目名称:thuctapcoso,代码行数:31,代码来源:view-order.php
示例13: printf
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.6.0
*/
if (!defined('ABSPATH')) {
exit;
}
?>
<p><?php
printf(__('Order #%1$s was placed on %2$s and is currently %3$s.', 'woocommerce'), '<mark class="order-number">' . $order->get_order_number() . '</mark>', '<mark class="order-date">' . date_i18n(get_option('date_format'), strtotime($order->order_date)) . '</mark>', '<mark class="order-status">' . wc_get_order_status_name($order->get_status()) . '</mark>');
?>
</p>
<?php
if ($notes = $order->get_customer_order_notes()) {
?>
<h2><?php
_e('Order Updates', 'woocommerce');
?>
</h2>
<ol class="woocommerce-OrderUpdates commentlist notes">
<?php
foreach ($notes as $note) {
?>
<li class="woocommerce-OrderUpdate comment note">
开发者ID:ksan5835,项目名称:maadithottam,代码行数:31,代码来源:view-order.php
示例14: test_wc_get_order_status_name
/**
* Test wc_get_order_status_name().
*
* @since 2.3.0
*/
public function test_wc_get_order_status_name()
{
$this->assertEquals(_x('Pending payment', 'Order status', 'woocommerce'), wc_get_order_status_name('wc-pending'));
$this->assertEquals(_x('Pending payment', 'Order status', 'woocommerce'), wc_get_order_status_name('pending'));
}
开发者ID:woocommerce,项目名称:woocommerce,代码行数:10,代码来源:functions.php
示例15: array
}
$products = array();
foreach ($order_line_items as $order_line_item) {
$products[] = array('guid' => $order_line_item['wc1c_guid'], 'name' => $order_line_item['name'], 'price_per_item' => $order_line_item['line_total'] / $order_line_item['qty'], 'quantity' => $order_line_item['qty'], 'total' => $order_line_item['line_total'], 'type' => "Товар");
}
foreach ($order_shipping_items as $order_shipping_item) {
if (!$order_shipping_item['cost']) {
continue;
}
$products[] = array('name' => $order_shipping_item['name'], 'price_per_item' => $order_shipping_item['cost'], 'quantity' => 1, 'total' => $order_shipping_item['cost'], 'type' => "Услуга");
}
$statuses = array('cancelled' => "Отменен", 'trash' => "Удален");
if (array_key_exists($order->status, $statuses)) {
$order_status_name = $statuses[$order->status];
} else {
$order_status_name = wc_get_order_status_name($order->status);
}
if (WC1C_CURRENCY) {
$document_currency = WC1C_CURRENCY;
} else {
$document_currency = get_option('wc1c_currency', @$order_meta['_order_currency']);
}
$document = array('order_id' => $order_post->ID, 'currency' => $document_currency, 'total' => @$order_meta['_order_total'], 'comment' => $order_post->post_excerpt, 'contragents' => $contragents, 'products' => $products, 'payment_method_title' => @$order_meta['_payment_method_title'], 'status' => $order->status, 'status_name' => $order_status_name, 'has_shipping' => count($order_shipping_items) > 0, 'modified_at' => $order_post->post_modified);
list($document['date'], $document['time']) = explode(' ', $order_post->post_date, 2);
$documents[] = $document;
}
$documents = apply_filters('wc1c_query_documents', $documents);
echo '<?xml version="1.0" encoding="' . WC1C_XML_CHARSET . '"?>';
?>
<КоммерческаяИнформация ВерсияСхемы="2.05" ДатаФормирования="<?php
开发者ID:anderpo,项目名称:himik,代码行数:31,代码来源:query.php
示例16: wc_print_notices
/**
* View Order
*
* Shows the details of a particular order on the account page
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
wc_print_notices();
echo beans_open_markup('woo_view_order_notice', 'p', array('class' => 'order-info'));
printf(__('Order #' . beans_open_markup('woo_view_order_notice_order_number', 'mark', array('class' => 'order-number')) . '%s' . beans_close_markup('woo_view_order_notice_order_number', 'mark') . ' was placed on ' . beans_open_markup('woo_view_order_notice_order_date', 'mark', array('class' => 'order-date')) . '%s' . beans_close_markup('woo_view_order_notice_order_date', 'mark') . ' and is currently ' . beans_open_markup('woo_view_order_notice_order_status', 'mark', array('class' => 'order-status')) . '%s' . beans_close_markup('woo_view_order_notice_order_status', 'mark') . '.', 'woocommerce'), $order->get_order_number(), date_i18n(get_option('date_format'), strtotime($order->order_date)), wc_get_order_status_name($order->get_status()));
echo beans_close_markup('woo_view_order_notice', 'p');
if ($notes = $order->get_customer_order_notes()) {
echo beans_open_markup('woo_view_order_title', 'h2');
_e('Order Updates', 'woocommerce');
echo beans_close_markup('woo_view_order_title', 'h2');
echo beans_open_markup('woo_view_order_comment_list', 'ol', array('class' => 'commentlist notes'));
foreach ($notes as $note) {
echo beans_open_markup('woo_view_order_comment_list_item', 'li', array('class' => 'comment note'));
echo beans_open_markup('woo_view_order_comment_container', 'div', array('class' => 'comment_container'));
echo beans_open_markup('woo_view_order_comment_text', 'div', array('class' => 'comment-text'));
echo beans_open_markup('woo_view_order_comment_meta', 'p', array('class' => 'meta'));
echo date_i18n(__('l jS \\o\\f F Y, h:ia', 'woocommerce'), strtotime($note->comment_date));
echo beans_close_markup('woo_view_order_comment_meta', 'p');
echo beans_open_markup('woo_view_order_comment_description', 'div', array('class' => 'description'));
echo wpautop(wptexturize($note->comment_content));
开发者ID:simondowdles,项目名称:woocommerce-overrides-for-beans,代码行数:31,代码来源:view-order.php
示例17: trigger
/**
* Trigger function
*
* @since 1.0.0
* @param int $order_id
*/
public function trigger($order_id)
{
if ($order_id) {
$this->object = wc_get_order($order_id);
if ('customer' == $this->type) {
$this->recipient = $this->object->billing_email;
}
// Supported variables in subject, heading and body text
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->find['order-status'] = '{order_status}';
$this->find['billing-first-name'] = '{billing_first_name}';
$this->find['billing-last-name'] = '{billing_last_name}';
$this->find['billing-company'] = '{billing_company}';
/**
* Filter the supported variables in subject, heading and body text
*
* @since 1.1.1
*
* @param array $find Associative array of placeholders.
* @param string $id E-mail ID
* @param string $type E-mail type
*/
$this->find = apply_filters('wc_order_status_manager_order_status_email_find_variables', $this->find, $this->id, $this->type);
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $this->object->get_order_number();
$this->replace['order-status'] = wc_get_order_status_name($this->object->get_status());
$this->replace['billing-first-name'] = $this->object->billing_first_name;
$this->replace['billing-last-name'] = $this->object->billing_last_name;
$this->replace['billing-company'] = $this->object->billing_company;
/**
* Filter the the srtings to replace in subject, heading and body text.
*
* @since 1.1.1
*
* @param array $replace Associative array of strings.
* @param string $id E-mail ID
* @param string $type E-mail type
*/
$this->replace = apply_filters('wc_order_status_manager_order_status_email_replace_variables', $this->replace, $this->id, $this->type);
}
if (!$this->is_enabled() || !$this->get_recipient()) {
return;
}
$this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
}
开发者ID:seoduda,项目名称:Patua,代码行数:52,代码来源:class-wc-order-status-manager-order-status-email.php
示例18: getOrder
/**
* Gets order
*
* @access public
* @param int $ID
* @return array
*/
public static function getOrder($ID)
{
$order = array();
if (self::isActive()) {
$object = wc_get_order($ID);
if (!empty($object)) {
$order['ID'] = $ID;
$order['object'] = $object;
$order['number'] = $object->get_order_number();
$order['date'] = $object->order_date;
$order['author'] = $object->post->post_author;
$order['status'] = $object->get_status();
$order['condition'] = wc_get_order_status_name($order['status']);
$order['total'] = $object->get_formatted_order_total();
$order['totals'] = $object->get_order_item_totals();
$order['products'] = $object->get_items();
foreach ($order['products'] as &$product) {
$product['subtotal'] = $object->get_formatted_line_subtotal($product);
$product['meta'] = new WC_Order_Item_Meta($product['item_meta']);
}
$order['customer'] = $object->get_user_id();
$order['email'] = $object->billing_email;
$order['phone'] = $object->billing_phone;
$order['billing_address'] = $object->get_formatted_billing_address();
$order['shipping_address'] = $object->get_formatted_shipping_address();
$order['customer_note'] = $object->post->post_excerpt;
$order['order_note'] = self::getNote($order['ID']);
}
}
return $order;
}
开发者ID:qhuit,项目名称:UrbanPekor,代码行数:38,代码来源:themex.woo.php
示例19: wp_kses_post
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
*/
if (!defined('ABSPATH')) {
exit;
// Exit if accessed directly
}
?>
<p class="order-info"><?php
echo wp_kses_post(apply_filters('woocommerce_order_tracking_status', sprintf(__('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())), $order));
?>
</p>
<?php
if ($notes = $order->get_customer_order_notes()) {
?>
<h2><?php
_e('Order Updates', 'woocommerce');
?>
</h2>
<ol class="commentlist notes">
<?php
foreach ($notes as $note) {
?>
<li class="comment note">
开发者ID:unfulvio,项目名称:woocommerce,代码行数:31,代码来源:tracking.php
示例20: status_transition
/**
* Handle the status transition.
*/
protected function status_transition()
{
if ($this->_status_transition) {
if (!empty($this->_status_transition['from'])) {
$transition_note = sprintf(__('Order status changed from %s to %s.', 'woocommerce'), wc_get_order_status_name($this->_status_transition['from']), wc_get_order_status_name($this->_status_transition['to']));
do_action('woocommerce_order_status_' . $this->_status_transition['from'] . '_to_' . $this->_status_transition['to'], $this->get_id());
do_action('woocommerce_order_status_changed', $this->get_id(), $this->_status_transition['from'], $this->_status_transition['to']);
} else {
$transition_note = sprintf(__('Order status set to %s.', 'woocommerce'), wc_get_order_status_name($this->_status_transition['to']));
}
do_action('woocommerce_order_status_' . $this->_status_transition['to'], $this->get_id());
// Note the transition occured
$this->add_order_note(trim($this->_status_transition['note'] . ' ' . $transition_note), 0, $this->_status_transition['manual']);
// This has ran, so reset status transition variable
$this->_status_transition = false;
}
}
开发者ID:pelmered,项目名称:woocommerce,代码行数:20,代码来源:class-wc-order.php
注:本文中的wc_get_order_status_name函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论