• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP woocommerce_date_format函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中woocommerce_date_format函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_date_format函数的具体用法?PHP woocommerce_date_format怎么用?PHP woocommerce_date_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了woocommerce_date_format函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: trigger

 /**
  * trigger function.
  *
  * @access public
  * @return void
  */
 function trigger($booking_id, $notification_subject, $notification_message, $attachments = array())
 {
     global $woocommerce;
     if ($booking_id) {
         $this->object = get_wc_booking($booking_id);
         $this->recipient = $this->object->get_order()->billing_email;
         $this->find[] = '{product_title}';
         $this->replace[] = $this->object->get_product()->get_title();
         $this->find[] = '{order_date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->get_order()->order_date));
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order()->get_order_number();
         $this->find[] = '{customer_name}';
         $this->replace[] = $this->object->get_order()->billing_first_name . ' ' . $this->object->get_order()->billing_last_name;
         $this->find[] = '{customer_first_name}';
         $this->replace[] = $this->object->get_order()->billing_first_name;
         $this->find[] = '{customer_last_name}';
         $this->replace[] = $this->object->get_order()->billing_last_name;
     }
     if (!$this->is_enabled() || !$this->get_recipient()) {
         return;
     }
     $this->heading = str_replace($this->find, $this->replace, $notification_subject);
     $this->subject = str_replace($this->find, $this->replace, $notification_subject);
     $this->notification_message = str_replace($this->find, $this->replace, $notification_message);
     $attachments = apply_filters('woocommerce_email_attachments', $attachments, $this->id, $this->object);
     $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $attachments);
 }
开发者ID:nomadicmarc,项目名称:goodbay,代码行数:34,代码来源:class-wc-email-booking-notification.php


示例2: trigger

 /**
  * trigger function.
  *
  * We need to override WC_Email_New_Order's trigger method because it expects to be run only once
  * per request.
  *
  * @access public
  * @return void
  */
 function trigger($order_id)
 {
     if ($order_id) {
         $this->object = new WC_Order($order_id);
         $order_date_index = array_search('{order_date}', $this->find);
         if (false === $order_date_index) {
             $this->find[] = '{order_date}';
             $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         } else {
             $this->replace[$order_date_index] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         }
         $order_number_index = array_search('{order_number}', $this->find);
         if (false === $order_number_index) {
             $this->find[] = '{order_number}';
             $this->replace[] = $this->object->get_order_number();
         } else {
             $this->replace[$order_number_index] = $this->object->get_order_number();
         }
         $this->subscriptions = wcs_get_subscriptions_for_switch_order($this->object);
     }
     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:ltdat287,项目名称:id.nhomdichvu,代码行数:34,代码来源:class-wcs-email-new-switch-order.php


示例3: trigger

 /**
  * trigger function.
  *
  * @access public
  * @return void
  *
  * @param unknown $order_id
  */
 function trigger($order_id)
 {
     global $woocommerce;
     if ($order_id) {
         $this->object = new WC_Order($order_id);
         $this->find[] = '{order_date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order_number();
     }
     if (!$this->is_enabled()) {
         return;
     }
     $vendors = $this->get_vendors($this->object);
     if (empty($vendors)) {
         return;
     }
     add_filter('woocommerce_order_get_items', array($this, 'check_items'), 10, 2);
     add_filter('woocommerce_get_order_item_totals', array($this, 'check_order_totals'), 10, 2);
     foreach ($vendors as $user_id => $user_email) {
         $this->current_vendor = $user_id;
         $this->send($user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
     }
     remove_filter('woocommerce_get_order_item_totals', array($this, 'check_order_totals'), 10, 2);
     remove_filter('woocommerce_order_get_items', array($this, 'check_items'), 10, 2);
 }
开发者ID:oleggen,项目名称:wcvendors,代码行数:34,代码来源:class-wc-notify-vendor.php


示例4: trigger

 /**
  * trigger function.
  *
  * We need to override WC_Email_Customer_Invoice's trigger method because it expects to be run only once
  * per request (but multiple subscription renewal orders can be generated per request).
  *
  * @access public
  * @return void
  */
 function trigger($order)
 {
     if (!is_object($order)) {
         $order = new WC_Order(absint($order));
     }
     if ($order) {
         $this->object = $order;
         $this->recipient = $this->object->billing_email;
         $order_date_index = array_search('{order_date}', $this->find);
         if (false === $order_date_index) {
             $this->find[] = '{order_date}';
             $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         } else {
             $this->replace[$order_date_index] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         }
         $order_number_index = array_search('{order_number}', $this->find);
         if (false === $order_number_index) {
             $this->find[] = '{order_number}';
             $this->replace[] = $this->object->get_order_number();
         } else {
             $this->replace[$order_number_index] = $this->object->get_order_number();
         }
     }
     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:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:37,代码来源:class-wcs-email-customer-renewal-invoice.php


示例5: trigger

 /**
  * Dispatch the email
  *
  * @since 1.0
  */
 public function trigger($args)
 {
     if (!empty($args)) {
         $defaults = array('order' => '', 'message' => '');
         $args = wp_parse_args($args, $defaults);
         extract($args);
         if (!is_object($order)) {
             return;
         }
         $this->object = $order;
         $this->recipient = $this->object->billing_email;
         $this->message = $message;
         $this->availability_date = WC_Pre_Orders_Product::get_localized_availability_date(WC_Pre_Orders_Order::get_pre_order_product($this->object));
         $this->find[] = '{order_date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         $this->find[] = '{release_date}';
         $this->replace[] = $this->availability_date;
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order_number();
     }
     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:shahadat014,项目名称:geleyi,代码行数:30,代码来源:class-wc-pre-orders-email-pre-order-date-changed.php


示例6: trigger

 /**
  * Dispatch the email
  *
  * @since 1.0
  */
 public function trigger($order_id)
 {
     if ($order_id) {
         $this->object = new WC_Order($order_id);
         $this->find[] = '{order_date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order_number();
     }
     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:Junaid-Farid,项目名称:gocnex,代码行数:19,代码来源:class-wc-pre-orders-email-new-pre-order.php


示例7: trigger

 /**
  * Determine if the email should actually be sent and setup email merge variables
  *
  * @since 0.1
  * @param int $order_id
  */
 public function trigger($order_id)
 {
     // setup order object
     $this->object = new WC_Order($order_id);
     $this->recipient = $this->object->billing_email;
     // replace variables in the subject/headings
     $this->find[] = '{order_date}';
     $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
     $this->find[] = '{order_number}';
     $this->replace[] = $this->object->get_order_number();
     if (!$this->is_enabled() || !$this->get_recipient()) {
         return;
     }
     // woohoo, send the email!
     $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
 }
开发者ID:JaneJieYing,项目名称:HiFridays,代码行数:22,代码来源:class-wc-processing-order-email.php


示例8: trigger

 public function trigger($order)
 {
     if (is_numeric($order)) {
         $this->object = new WC_Order(absint($order));
     } elseif ($order instanceof WC_Order) {
         $this->object = $order;
     }
     $this->recipient = $this->object->billing_email;
     $this->find[] = '{order_number}';
     $this->replace[] = $this->object->get_order_number();
     $this->find[] = '{date}';
     $this->replace[] = date_i18n(woocommerce_date_format(), time());
     if (!$this->get_recipient()) {
         return;
     }
     $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
 }
开发者ID:animir,项目名称:wc-edostavka,代码行数:17,代码来源:class-wc-email-edostavka-points.php


示例9: trigger

 /**
  * Trigger email.
  *
  * @param  WC_Order $order         Order data.
  * @param  string   $tracking_code Tracking code.
  *
  * @return void
  */
 public function trigger($order, $tracking_code)
 {
     if (is_object($order)) {
         $this->object = $order;
         $this->recipient = $this->object->billing_email;
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order_number();
         $this->find[] = '{date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), time());
         $this->find[] = '{tracking_code}';
         $this->replace[] = $this->get_tracking_code_url($tracking_code);
     }
     if (!$this->get_recipient()) {
         return;
     }
     $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
 }
开发者ID:pensesmart,项目名称:woocommerce-correios,代码行数:25,代码来源:class-wc-email-correios-tracking.php


示例10: trigger

 /**
  * Dispatch the email
  *
  * @since 1.0
  */
 public function trigger($order_id, $message)
 {
     if ($order_id) {
         $this->object = new WC_Order($order_id);
         $this->recipient = $this->object->billing_email;
         $this->message = $message;
         $this->find[] = '{order_date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         $this->find[] = '{release_date}';
         $this->replace[] = WC_Pre_Orders_Product::get_localized_availability_date(WC_Pre_Orders_Order::get_pre_order_product($this->object));
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order_number();
     }
     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:Junaid-Farid,项目名称:gocnex,代码行数:23,代码来源:class-wc-pre-orders-email-pre-order-cancelled.php


示例11: trigger

 /**
  * trigger function.
  *
  * @access public
  * @return void
  */
 function trigger($booking_id)
 {
     global $woocommerce;
     if ($booking_id) {
         $this->object = get_wc_booking($booking_id);
         $this->recipient = $this->object->get_order()->billing_email;
         $this->find[] = '{product_title}';
         $this->replace[] = $this->object->get_product()->get_title();
         $this->find[] = '{order_date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->get_order()->order_date));
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order()->get_order_number();
     }
     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:nomadicmarc,项目名称:goodbay,代码行数:24,代码来源:class-wc-email-booking-reminder.php


示例12: trigger

 /**
  * trigger function.
  *
  * @access public
  * @return void
  */
 function trigger($args)
 {
     if ($args) {
         $defaults = array('order_id' => '', 'customer_note' => '');
         $args = wp_parse_args($args, $defaults);
         extract($args);
         $this->object = new WC_Order($order_id);
         $this->recipient = $this->object->billing_email;
         $this->customer_note = $customer_note;
         $this->find[] = '{order_date}';
         $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
         $this->find[] = '{order_number}';
         $this->replace[] = $this->object->get_order_number();
     }
     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:chhavinav,项目名称:fr.ilovejuice,代码行数:25,代码来源:class-wc-email-customer-note.php


示例13: trigger

 /**
  * Determine if the email should actually be sent and setup email merge variables
  *
  * @since 0.1
  * @param int $order_id
  */
 public function trigger($order_id)
 {
     // bail if no order ID is present
     if (!$order_id) {
         return;
     }
     // setup order object
     $this->object = new WC_Order($order_id);
     // bail if shipping method is not expedited
     if (!in_array($this->object->get_shipping_method(), array('Three Day Shipping', 'Next Day Shipping'))) {
         return;
     }
     // replace variables in the subject/headings
     $this->find[] = '{order_date}';
     $this->replace[] = date_i18n(woocommerce_date_format(), strtotime($this->object->order_date));
     $this->find[] = '{order_number}';
     $this->replace[] = $this->object->get_order_number();
     if (!$this->is_enabled() || !$this->get_recipient()) {
         return;
     }
     // woohoo, send the email!
     $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
 }
开发者ID:jvcanote,项目名称:woocommerce-expedited-order-email,代码行数:29,代码来源:class-wc-expedited-order-email.php


示例14: maybe_replace_pay_shortcode

 /**
  * If requesting a payment method change, replace the woocommerce_pay_shortcode() with a change payment form.
  *
  * @since 1.4
  */
 public static function maybe_replace_pay_shortcode()
 {
     global $woocommerce;
     if (!self::$is_request_to_change_payment) {
         return;
     }
     ob_clean();
     do_action('before_woocommerce_pay');
     echo '<div class="woocommerce">';
     if (!empty(self::$woocommerce_errors)) {
         foreach (self::$woocommerce_errors as $error) {
             WC_Subscriptions::add_notice($error, 'error');
         }
     }
     if (!empty(self::$woocommerce_messages)) {
         foreach (self::$woocommerce_messages as $message) {
             WC_Subscriptions::add_notice($message, 'success');
         }
     }
     $subscription_key = $_GET['change_payment_method'];
     $subscription = WC_Subscriptions_Manager::get_subscription($subscription_key);
     if (wp_verify_nonce($_GET['_wpnonce'], __FILE__) === false) {
         WC_Subscriptions::add_notice(__('There was an error with your request. Please try again.', 'woocommerce-subscriptions'), 'error');
         WC_Subscriptions::print_notices();
     } elseif (!WC_Subscriptions_Manager::user_owns_subscription($subscription_key)) {
         WC_Subscriptions::add_notice(__('That doesn\'t appear to be one of your subscriptions.', 'woocommerce-subscriptions'), 'error');
         WC_Subscriptions::print_notices();
     } elseif (empty($subscription)) {
         WC_Subscriptions::add_notice(__('Invalid subscription.', 'woocommerce-subscriptions'), 'error');
         WC_Subscriptions::print_notices();
     } elseif (!WC_Subscriptions_Manager::can_subscription_be_changed_to('new-payment-method', $subscription_key, get_current_user_id())) {
         WC_Subscriptions::add_notice(__('The payment method can not be changed for that subscription.', 'woocommerce-subscriptions'), 'error');
         WC_Subscriptions::print_notices();
     } else {
         $order = new WC_Order($subscription['order_id']);
         $order_id = absint($_GET['order_id']);
         $order_key = isset($_GET['key']) ? $_GET['key'] : $_GET['order'];
         $product_id = $subscription['product_id'];
         $next_payment_timestamp = WC_Subscriptions_Order::get_next_payment_timestamp($order, $product_id);
         if (!empty($next_payment_timestamp)) {
             $next_payment_string = sprintf(__(' Next payment is due %s.', 'woocommerce-subscriptions'), date_i18n(woocommerce_date_format(), $next_payment_timestamp));
         } else {
             $next_payment_string = '';
         }
         WC_Subscriptions::add_notice(sprintf(__('Choose a new payment method.%s', 'woocommerce-subscriptions'), $next_payment_string), 'notice');
         WC_Subscriptions::print_notices();
         if ($order->order_key == $order_key) {
             // Set customer location to order location
             if ($order->billing_country) {
                 $woocommerce->customer->set_country($order->billing_country);
             }
             if ($order->billing_state) {
                 $woocommerce->customer->set_state($order->billing_state);
             }
             if ($order->billing_postcode) {
                 $woocommerce->customer->set_postcode($order->billing_postcode);
             }
             // Show form
             WC_Subscriptions_Order::$recurring_only_price_strings = true;
             woocommerce_get_template('checkout/form-change-payment-method.php', array('order' => $order, 'subscription_key' => $subscription_key), '', plugin_dir_path(WC_Subscriptions::$plugin_file) . 'templates/');
             WC_Subscriptions_Order::$recurring_only_price_strings = false;
         } else {
             WC_Subscriptions::add_notice(__('Invalid order.', 'woocommerce-subscriptions'), 'error');
             WC_Subscriptions::print_notices();
         }
     }
 }
开发者ID:jgabrielfreitas,项目名称:MultipagosTestesAPP,代码行数:72,代码来源:class-wc-subscriptions-change-payment-gateway.php


示例15: __

 * @version     2.0.0
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
echo $email_heading . "\n\n";
echo __("Hello, a note has just been added to your order:", 'woocommerce') . "\n\n";
echo "----------\n\n";
echo wptexturize($customer_note) . "\n\n";
echo "----------\n\n";
echo __("For your reference, your order details are shown below.", 'woocommerce') . "\n\n";
echo "****************************************************\n\n";
do_action('woocommerce_email_before_order_table', $order, false);
echo sprintf(__('Order number: %s', 'woocommerce'), $order->get_order_number()) . "\n";
echo sprintf(__('Order date: %s', 'woocommerce'), date_i18n(woocommerce_date_format(), strtotime($order->order_date))) . "\n";
do_action('woocommerce_email_order_meta', $order, false, true);
echo "\n" . $order->email_order_items_table($order->is_download_permitted(), true, '', '', '', true);
echo "----------\n\n";
if ($totals = $order->get_order_item_totals()) {
    foreach ($totals as $total) {
        echo $total['label'] . "\t " . $total['value'] . "\n";
    }
}
echo "\n****************************************************\n\n";
do_action('woocommerce_email_after_order_table', $order, false, true);
echo __('Your details', 'woocommerce') . "\n\n";
if ($order->billing_email) {
    echo __('Email:', 'woocommerce');
}
echo $order->billing_email . "\n";
开发者ID:rongandat,项目名称:sallumeh,代码行数:31,代码来源:customer-note.php


示例16: _e

			<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php 
_e('End Date', 'woocommerce-subscriptions');
?>
</th>
		</tr>
	</thead>
	<tbody>
	<?php 
foreach ($order->get_items() as $item) {
    if (WC_Subscriptions_Order::is_item_subscription($order, $item)) {
        ?>
			<tr>
				<td scope="row" style="text-align:left; border: 1px solid #eee;"><?php 
        echo $item['name'];
        ?>
</td>
				<td scope="row" style="text-align:left; border: 1px solid #eee;"><?php 
        echo date_i18n(woocommerce_date_format(), strtotime($item['subscription_start_date']));
        ?>
</td>
				<td scope="row" style="text-align:left; border: 1px solid #eee;"><?php 
        echo !empty($item['subscription_expiry_date']) ? date_i18n(woocommerce_date_format(), strtotime($item['subscription_expiry_date'])) : __('When Cancelled', 'woocommerce-subscriptions');
        ?>
			</tr>
			<?php 
    }
}
?>
	</tbody>
</table>
开发者ID:jgabrielfreitas,项目名称:MultipagosTestesAPP,代码行数:30,代码来源:subscription-info.php


示例17: customise_subscription_price_string

 /**
  * Add the next payment date to the end of the subscription to clarify when the new rate will be charged
  *
  * @since 1.4
  */
 public static function customise_subscription_price_string($subscription_string)
 {
     $switch_details = self::cart_contains_subscription_switch();
     if (false !== $switch_details && 0 != $switch_details['first_payment_timestamp']) {
         $subscription_string = sprintf(__('%s %s(next payment %s)%s', 'woocommerce-subscriptions'), $subscription_string, '<small>', date_i18n(woocommerce_date_format(), $switch_details['first_payment_timestamp']), '</small>');
     }
     return $subscription_string;
 }
开发者ID:jgabrielfreitas,项目名称:MultipagosTestesAPP,代码行数:13,代码来源:class-wc-subscriptions-switcher.php


示例18: get_products_first_payment_date

 /**
  * Return a string explaining when the first payment will be completed for the subscription.
  *
  * @since 1.5
  */
 public static function get_products_first_payment_date($product)
 {
     $first_payment_date = '';
     if (self::is_product_synced($product)) {
         $first_payment_timestamp = self::calculate_first_payment_date($product->id, 'timestamp');
         if (0 != $first_payment_timestamp) {
             $is_first_payment_today = self::is_today($first_payment_timestamp);
             if ($is_first_payment_today) {
                 $payment_date_string = __('Today!', 'woocommerce-subscriptions');
             } else {
                 $payment_date_string = date_i18n(woocommerce_date_format(), $first_payment_timestamp + get_option('gmt_offset') * HOUR_IN_SECONDS);
             }
             if (self::is_product_prorated($product) && !$is_first_payment_today) {
                 $first_payment_date = sprintf(__('First payment prorated. Next payment: %s', 'woocommerce-subscriptions'), $payment_date_string);
             } else {
                 $first_payment_date = sprintf(__('First payment: %s', 'woocommerce-subscriptions'), $payment_date_string);
             }
             $first_payment_date = '<small>' . $first_payment_date . '</small>';
         }
     }
     return apply_filters('woocommerce_subscriptions_synced_first_payment_date_string', $first_payment_date, $product);
 }
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:27,代码来源:class-wc-subscriptions-synchroniser.php


示例19: apg_sms_procesa_variables

 function apg_sms_procesa_variables($mensaje, $pedido, $variables, $nota = '')
 {
     $apg_sms = array("id", "status", "prices_include_tax", "tax_display_cart", "display_totals_ex_tax", "display_cart_ex_tax", "order_date", "modified_date", "customer_message", "customer_note", "post_status", "shop_name", "note", "order_product");
     $apg_sms_variables = array("order_key", "billing_first_name", "billing_last_name", "billing_company", "billing_address_1", "billing_address_2", "billing_city", "billing_postcode", "billing_country", "billing_state", "billing_email", "billing_phone", "shipping_first_name", "shipping_last_name", "shipping_company", "shipping_address_1", "shipping_address_2", "shipping_city", "shipping_postcode", "shipping_country", "shipping_state", "shipping_method", "shipping_method_title", "payment_method", "payment_method_title", "order_discount", "cart_discount", "order_tax", "order_shipping", "order_shipping_tax", "order_total");
     $variables_personalizadas = explode("\n", str_replace(array("\r\n", "\r"), "\n", $variables));
     $variables_de_pedido = get_post_custom($pedido->id);
     //WooCommerce 2.1
     preg_match_all("/%(.*?)%/", $mensaje, $busqueda);
     foreach ($busqueda[1] as $variable) {
         $variable = strtolower($variable);
         if (!in_array($variable, $apg_sms) && !in_array($variable, $apg_sms_variables) && !in_array($variable, $variables_personalizadas)) {
             continue;
         }
         $especiales = array("order_date", "modified_date", "shop_name", "note", "id", "order_product");
         if (!in_array($variable, $especiales)) {
             if (in_array($variable, $apg_sms)) {
                 $mensaje = str_replace("%" . $variable . "%", $pedido->{$variable}, $mensaje);
                 //Variables estándar - Objeto
             } else {
                 if (in_array($variable, $apg_sms_variables)) {
                     $mensaje = str_replace("%" . $variable . "%", $variables_de_pedido["_" . $variable][0], $mensaje);
                     //Variables estándar - Array
                 } else {
                     if (isset($variables_de_pedido[$variable]) || in_array($variable, $variables_personalizadas)) {
                         $mensaje = str_replace("%" . $variable . "%", $variables_de_pedido[$variable][0], $mensaje);
                         //Variables de pedido y personalizadas
                     }
                 }
             }
         } else {
             if ($variable == "order_date" || $variable == "modified_date") {
                 $mensaje = str_replace("%" . $variable . "%", date_i18n(woocommerce_date_format(), strtotime($pedido->{$variable})), $mensaje);
             } else {
                 if ($variable == "shop_name") {
                     $mensaje = str_replace("%" . $variable . "%", get_bloginfo('name'), $mensaje);
                 } else {
                     if ($variable == "note") {
                         $mensaje = str_replace("%" . $variable . "%", $nota, $mensaje);
                     } else {
                         if ($variable == "id") {
                             $mensaje = str_replace("%" . $variable . "%", $pedido->get_order_number(), $mensaje);
                         } else {
                             if ($variable == "order_product") {
                                 $productos = $pedido->get_items();
                                 $nombre = $productos[key($productos)]['name'];
                                 if (strlen($nombre) > 10) {
                                     $nombre = substr($nombre, 0, 10) . "...";
                                 }
                                 if (count($productos) > 1) {
                                     $nombre .= " (+" . (count($productos) - 1) . ")";
                                 }
                                 $mensaje = str_replace("%" . $variable . "%", $nombre, $mensaje);
                             }
                         }
                     }
                 }
             }
         }
     }
     $mensaje = apply_filters('apg_sms_message', $mensaje, $pedido->id);
     return $mensaje;
 }
开发者ID:artprojectgroup,项目名称:woocommerce-apg-sms-notifications,代码行数:62,代码来源:apg-sms.php


示例20: __

if ('pending' == $order->status) {
    echo __("Your pre-order is now available, but requires payment. Please pay for your pre-order now : ", WC_Pre_Orders::TEXT_DOMAIN) . esc_url($order->get_checkout_payment_url()) . "\n\n";
} elseif ('failed' == $order->status || 'on-hold' == $order->status) {
    echo __("Your pre-order is now available, but automatic payment failed. Please update your payment information now : ", WC_Pre_Orders::TEXT_DOMAIN) . esc_url($order->get_checkout_payment_url()) . "\n\n";
} else {
    echo __("Your pre-order is now available. Your order details are shown below for your reference.", WC_Pre_Orders::TEXT_DOMAIN) . "\n\n";
}
if ($message) {
    echo "----------\n\n";
    echo wptexturize($message) . "\n\n";
    echo "----------\n\n";
}
echo "****************************************************\n\n";
do_action('woocommerce_email_before_order_table', $order, false);
echo sprintf(__('Order number: %s', WC_Pre_Orders::TEXT_DOMAIN), $order->get_order_number()) . "\n";
echo sprintf(__('Order date: %s', WC_Pre_Orders::TEXT_DOMAIN), date_i18n(woocommerce_date_format(), strtotime($order->order_date))) . "\n";
do_action('woocommerce_email_order_meta', $order, false, true);
echo "\n" . $order->email_order_items_table($order->is_download_permitted(), true, $order->status == 'processing' ? true : false, '', '', true);
echo "----------\n\n";
if ($totals = $order->get_order_item_totals()) {
    foreach ($totals as $total) {
        echo $total['label'] . "\t " . $total['value'] . "\n";
    }
}
echo "\n****************************************************\n\n";
do_action('woocommerce_email_after_order_table', $order, false, true);
echo __('Your details', WC_Pre_Orders::TEXT_DOMAIN) . "\n\n";
if ($order->billing_email) {
    echo __('Email:', WC_Pre_Orders::TEXT_DOMAIN);
}
echo $order->billing_email . "\n";
开发者ID:shahadat014,项目名称:geleyi,代码行数:31,代码来源:customer-pre-order-available.php



注:本文中的woocommerce_date_format函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP woocommerce_form_field函数代码示例发布时间:2022-05-23
下一篇:
PHP woocommerce_content函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap