本文整理汇总了PHP中woocommerce_date_format函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_date_format函数的具体用法?PHP woocommerce_date_format怎么用?PHP woocommerce_date_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce_date_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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());
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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";