本文整理汇总了PHP中wc_date_format函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_date_format函数的具体用法?PHP wc_date_format怎么用?PHP wc_date_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wc_date_format函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: trigger
/**
* trigger function.
*/
function trigger($booking_id)
{
if ($booking_id) {
$this->object = get_wc_booking($booking_id);
if ($this->object->has_status('in-cart')) {
return;
}
$this->find[] = '{product_title}';
$this->replace[] = $this->object->get_product()->get_title();
if ($this->object->get_order()) {
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_date_format(), strtotime($this->object->get_order()->order_date));
$this->find[] = '{order_number}';
$this->replace[] = $this->object->get_order()->get_order_number();
} else {
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_date_format(), strtotime($this->object->booking_date));
$this->find[] = '{order_number}';
$this->replace[] = __('N/A', 'woocommerce-bookings');
}
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:tonyvu1985,项目名称:appletutorings,代码行数:29,代码来源:class-wc-email-new-booking.php
示例2: sv_wc_memberships_member_discount_product_notice
/**
* Check if a product has a member discount
* Example: Display a member discount notice
*/
function sv_wc_memberships_member_discount_product_notice()
{
// bail if Memberships isn't active
if (!function_exists('wc_memberships')) {
return;
}
// Set a discount end date
$discount_ends = date_i18n(wc_date_format(), strtotime('2015-12-31'));
// Add our top notice if the member has a discount
if (wc_memberships_user_has_member_discount()) {
wc_print_notice(sprintf('Act fast! Your member discount ends on %s.', $discount_ends), 'notice');
}
}
开发者ID:skyverge,项目名称:wc-plugins-snippets,代码行数:17,代码来源:product-member-discount-notice.php
示例3: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($booking_id)
{
if ($booking_id) {
$this->object = get_wc_booking($booking_id);
if ($this->object->get_product()) {
$this->find[] = '{product_title}';
$this->replace[] = $this->object->get_product()->get_title();
}
if ($this->object->get_order()) {
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_date_format(), strtotime($this->object->get_order()->order_date));
$this->find[] = '{order_number}';
$this->replace[] = $this->object->get_order()->get_order_number();
$this->recipient = $this->object->get_order()->billing_email;
} else {
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_date_format(), strtotime($this->object->booking_date));
$this->find[] = '{order_number}';
$this->replace[] = __('N/A', 'woocommerce-bookings');
if ($this->object->customer_id && ($customer = get_user_by('id', $this->object->customer_id))) {
$this->recipient = $customer->user_email;
}
}
}
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:tonyvu1985,项目名称:appletutorings,代码行数:35,代码来源:class-wc-email-booking-cancelled.php
示例4: trigger
/**
* Trigger.
*
* @version 2.4.0
*/
function trigger($order_id)
{
if ($order_id) {
$this->object = wc_get_order($order_id);
if ($this->customer_email) {
$this->recipient = $this->object->billing_email;
}
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $this->object->get_order_number();
}
if (!$this->is_enabled() || !$this->get_recipient()) {
return;
}
if ($order_id) {
global $post;
$order = wc_get_order($order_id);
$post = $order->post;
setup_postdata($post);
}
$this->send($this->get_recipient(), $this->get_subject(), do_shortcode($this->get_content()), $this->get_headers(), $this->get_attachments());
if ($order_id) {
wp_reset_postdata();
}
}
开发者ID:bailoo,项目名称:10dollrWP,代码行数:31,代码来源:class-wc-email-wcj-custom.php
示例5: 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(wc_date_format(), strtotime($this->object->order_date));
} else {
$this->replace[$order_date_index] = date_i18n(wc_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:DustinHartzler,项目名称:TheCLEFT,代码行数:37,代码来源:class-wcs-email-customer-renewal-invoice.php
示例6: 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(wc_date_format(), strtotime($this->object->order_date));
} else {
$this->replace[$order_date_index] = date_i18n(wc_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:DustinHartzler,项目名称:TheCLEFT,代码行数:34,代码来源:class-wcs-email-new-switch-order.php
示例7: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($order_id)
{
$vendors = get_vendor_from_an_order($order_id);
if ($vendors) {
foreach ($vendors as $vendor) {
$vendor_obj = get_wcmp_vendor_by_term($vendor);
$vendor_email = $vendor_obj->user_data->user_email;
$vendor_id = $vendor_obj->term_id;
if ($order_id && $vendor_email) {
$this->object = new WC_Order($order_id);
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->find[] = '{order_number}';
$this->replace[] = $this->object->get_order_number();
$this->vendor_email = $vendor_email;
$this->vendor_id = $vendor_id;
$this->recipient = $vendor_email;
}
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:qhuit,项目名称:UrbanPekor,代码行数:31,代码来源:class-wcmp-email-vendor-new-order.php
示例8: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($order)
{
if (!is_object($order)) {
$order = wc_get_order(absint($order));
}
if ($order) {
$this->object = $order;
$this->recipient = $this->object->billing_email;
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $this->object->get_order_number();
}
if (!$this->get_recipient()) {
return;
}
if (version_compare(WOOCOMMERCE_VERSION, '2.2', '<')) {
return;
}
$refunds = $order->get_refunds();
if (empty($refunds)) {
return;
}
$result = $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
do_action('wpo_wcpdf_pro_email_sent', $result, $this->id, $order);
}
开发者ID:baden03,项目名称:access48,代码行数:32,代码来源:email-customer-credit-note.php
示例9: add_checkout_time_to_booking_end_time
public function add_checkout_time_to_booking_end_time($date, $booking)
{
$product = wc_get_product($booking->product_id);
if (empty($product) || 'accommodation-booking' !== $product->product_type) {
return $date;
}
$check_out = get_option('woocommerce_accommodation_bookings_check_out', '');
$date_format = apply_filters('woocommerce_bookings_date_format', wc_date_format());
$time_format = apply_filters('woocommerce_bookings_time_format', ', ' . wc_time_format());
return date_i18n($date_format, $booking->end) . date_i18n($time_format, strtotime("Today " . $check_out));
}
开发者ID:solaceten,项目名称:woocommerce-accommodation-bookings,代码行数:11,代码来源:class-wc-accommodation-booking.php
示例10: trigger
/**
* Trigger.
*
* @param int $order_id
*/
function trigger($order_id)
{
if ($order_id) {
$this->object = wc_get_order($order_id);
$this->recipient = $this->object->billing_email;
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $this->object->get_order_number();
$customer_id = $this->object->post->post_author;
$customer_code = get_the_author_meta('customercode', $customer_id);
/** Send order details to notification server. **/
$order_list = array();
foreach ($this->object->get_items() as $val) {
$vendor_name = $val['roaster'];
$vendor_email = $val['roaster_email'];
if (!array_key_exists($vendor_name, $order_list)) {
$order_list[$vendor_name] = array('roaster' => $vendor_name, 'roaster_email' => $vendor_email, 'orders' => array());
}
$product_id = $val['product_id'];
$order_meta = get_post_custom($order_id);
$product_meta = get_post_custom($product_id);
$orders = array('product_name' => $val['name'], 'product_code' => $product_meta['product_code'][0], 'unit_size' => $product_meta['unit_size'][0], 'unit_quantity' => $product_meta['unit_quantity'][0], 'currency' => $order_meta['_order_currency'][0], 'quantity' => $val['qty'], 'cost' => '¥' . $val['line_subtotal']);
array_push($order_list[$vendor_name]['orders'], $orders);
}
$order_data = array('customer_code' => $customer_code, 'order_id' => $order_id, 'order_date' => date_i18n(wc_date_format(), strtotime($this->object->order_date)), 'notes' => $this->object->customer_note, 'customer_email' => $this->object->billing_email, 'customer_telephone' => $this->object->billing_phone, 'shipping_address' => $this->object->get_address(), 'orders' => $order_list, 'totals' => $this->object->get_order_item_totals());
if (array_key_exists($order_data['shipping_address']['state'], $this->states)) {
$order_data['shipping_address']['state'] = $this->states[$order_data['shipping_address']['state']];
}
$curl_url = "http://services.coffeeconnection.jp/newOrder";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $curl_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($order_data));
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status != 204) {
} else {
error_log("Successfully sent order_data: " . json_encode($order_data) . " \nresponse: {$response} , status: {$status}");
}
curl_close($ch);
}
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:kevinotsuka,项目名称:coffeecircle,代码行数:57,代码来源:class-wc-email-customer-processing-order.php
示例11: trigger
/**
* Determine if the email should actually be sent and setup email merge variables
*
* @since 1.0.1
*/
public function trigger($offer_args)
{
$this->recipient = $offer_args['recipient'];
$this->offer_args = $offer_args;
if (!$this->is_enabled() || !$this->recipient) {
return;
}
$this->find['offer_date'] = '{offer_date}';
$this->find['offer_number'] = '{offer_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime(date('Y-m-d H:i:s')));
$this->replace['offer_number'] = $this->offer_args['offer_id'];
// woohoo, send the email!
$this->send($this->recipient, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
}
开发者ID:k2jysy,项目名称:kshop,代码行数:19,代码来源:class-wc-offer-on-hold-email.php
示例12: trigger
/**
* Trigger.
*/
function trigger($order_id)
{
if ($order_id) {
$this->object = wc_get_order($order_id);
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $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:CannedHead,项目名称:feelingsurf,代码行数:17,代码来源:class-wc-email-new-order.php
示例13: trigger
/**
* Trigger email.
*
* @param WC_Order $order Order data.
* @param string $tracking_code Tracking code.
*/
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(wc_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:dbasilioesp,项目名称:woocommerce-correios,代码行数:23,代码来源:class-wc-correios-tracking-email.php
示例14: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($order_id, $customer_email, $vendor_id)
{
if ($order_id && $customer_email && $vendor_id) {
$this->object = new WC_Order($order_id);
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->find[] = '{order_number}';
$this->replace[] = $this->object->get_order_number();
$this->vendor_id = $vendor_id;
//$user = get_user_by( 'id', $user_id );
$this->recipient = $customer_email;
}
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:qhuit,项目名称:UrbanPekor,代码行数:23,代码来源:class-wcmp-email-vendor-notify-shipped.php
示例15: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($object)
{
if (!is_object($object)) {
$object = get_post($object);
if ($object->post_type == 'shop_order') {
$object = wc_get_order($object->ID);
} else {
if ($object->post_type == 'invoice') {
$object = wc_gzdp_get_invoice($object->ID);
}
}
}
if (is_object($object)) {
$this->object = $object;
// Look for the actual invoice
if ($object instanceof WC_Order) {
if ($object->invoices) {
foreach ($object->invoices as $invoice) {
$invoice = wc_gzdp_get_invoice($invoice);
if ($invoice->is_type('simple')) {
$this->object = $invoice;
break;
}
}
}
}
if (!$this->object instanceof WC_GZDP_Invoice) {
return;
}
$recipient = $this->object->recipient;
$this->recipient = $recipient['mail'];
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->find['invoice-number'] = '{invoice_number}';
$order_data = $this->object->order_data;
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($order_data['date']));
$this->replace['order-number'] = $this->object->order;
$this->replace['invoice-number'] = $this->object->get_number(true);
$this->object->mark_as_sent();
}
if (!$this->get_recipient()) {
return;
}
$this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
}
开发者ID:radscheit,项目名称:unicorn,代码行数:51,代码来源:class-wc-gzdp-email-customer-invoice-simple.php
示例16: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($order)
{
if (!is_object($order)) {
$order = wc_get_order(absint($order));
}
if ($order) {
$this->object = $order;
$this->recipient = $this->object->billing_email;
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $this->object->get_order_number();
}
if (!$this->get_recipient()) {
return;
}
$this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
}
开发者ID:donpapa26,项目名称:bakancslistad,代码行数:24,代码来源:class-wc-email-customer-invoice.php
示例17: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($order)
{
if (!is_object($order)) {
$order = wc_get_order(absint($order));
}
if ($order) {
$this->object = $order;
$this->recipient = $this->get_option('recipient');
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $this->object->get_order_number();
}
if (!$this->get_recipient()) {
return;
}
$result = $this->send($this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments());
do_action('wpo_wcpdf_pro_email_sent', $result, $this->id, $order);
}
开发者ID:baden03,项目名称:access48,代码行数:25,代码来源:email-pdf-order-notification.php
示例18: 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 = wc_get_order($order_id);
$this->recipient = $this->object->billing_email;
$this->customer_note = $customer_note;
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n(wc_date_format(), strtotime($this->object->order_date));
$this->replace['order-number'] = $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:anagio,项目名称:woocommerce,代码行数:25,代码来源:class-wc-email-customer-note.php
示例19: trigger
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger($booking_id, $notification_subject, $notification_message, $attachments = array())
{
if ($booking_id) {
$this->object = get_wc_booking($booking_id);
$this->find[] = '{product_title}';
$this->replace[] = $this->object->get_product()->get_title();
if ($this->object->get_order()) {
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_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;
$this->recipient = $this->object->get_order()->billing_email;
} else {
$this->find[] = '{order_date}';
$this->replace[] = date_i18n(wc_date_format(), strtotime($this->object->booking_date));
$this->find[] = '{order_number}';
$this->replace[] = __('N/A', 'woocommerce-bookings');
$this->find[] = '{customer_name}';
$this->replace[] = __('N/A', 'woocommerce-bookings');
$this->find[] = '{customer_first_name}';
$this->replace[] = __('N/A', 'woocommerce-bookings');
$this->find[] = '{customer_last_name}';
$this->replace[] = __('N/A', 'woocommerce-bookings');
if ($this->object->customer_id && ($customer = get_user_by('id', $this->object->customer_id))) {
$this->recipient = $customer->user_email;
}
}
}
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:tonyvu1985,项目名称:appletutorings,代码行数:49,代码来源:class-wc-email-booking-notification.php
示例20: trigger
/**
* Trigger.
*/
function trigger($order_id)
{
if ($order_id) {
$this->object = wc_get_order($order_id);
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->find['donation-project-name'] = '{project_name}';
$order_id = $this->object->get_order_number();
$project_id = WC_QD()->db()->get_project_id($order_id);
$project_name = get_the_title($project_id);
$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['donation-project-name'] = $project_name;
}
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:bestmazzo,项目名称:woocomerce-quick-donation,代码行数:22,代码来源:class-new-email.php
注:本文中的wc_date_format函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论