当前位置: 首页>>代码示例>>PHP>>正文


PHP edd_get_payment_amount函数代码示例

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


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

示例1: get_data

 /**
  * Get the data being exported
  *
  * @access      public
  * @since       1.2
  * @return      array
  */
 public function get_data()
 {
     global $edd_logs;
     $data = array();
     $args = array('nopaging' => true, 'post_type' => 'edd_payment', 'meta_key' => '_edd_payment_shipping_status', 'meta_value' => '1', 'fields' => 'ids');
     $payments = get_posts($args);
     if ($payments) {
         foreach ($payments as $payment) {
             $user_info = edd_get_payment_meta_user_info($payment);
             $downloads = edd_get_payment_meta_cart_details($payment);
             $products = '';
             if ($downloads) {
                 foreach ($downloads as $key => $download) {
                     // Display the Downoad Name
                     $products .= get_the_title($download['id']);
                     if ($key != count($downloads) - 1) {
                         $products .= ' / ';
                     }
                 }
             }
             $data[] = array('id' => $payment, 'date' => get_post_field('post_date', $payment), 'first_name' => $user_info['first_name'], 'last_name' => $user_info['last_name'], 'email' => $user_info['email'], 'address' => $user_info['shipping_info']['address'], 'address2' => !empty($user_info['shipping_info']['address2']) ? $user_info['shipping_info']['address2'] : '', 'city' => $user_info['shipping_info']['city'], 'state' => $user_info['shipping_info']['state'], 'zip' => $user_info['shipping_info']['zip'], 'country' => $user_info['shipping_info']['country'], 'amount' => edd_get_payment_amount($payment), 'tax' => edd_get_payment_tax($payment), 'gateway' => edd_get_payment_gateway($payment), 'key' => edd_get_payment_key($payment), 'products' => $products, 'status' => get_post_field('post_status', $payment));
         }
     }
     $data = apply_filters('edd_export_get_data', $data);
     $data = apply_filters('edd_export_get_data_' . $this->export_type, $data);
     return $data;
 }
开发者ID:JiveDig,项目名称:EDD-Simple-Shipping,代码行数:34,代码来源:class-shipping-export.php

示例2: get_data

 /**
  * Get the Export Data
  *
  * @access public
  * @since 2.5
  * @global object $wpdb Used to query the database using the WordPress
  *   Database API
  * @return array $data The data for the CSV file
  */
 public function get_data()
 {
     $customer = new EDD_Customer($this->customer_id);
     $payments = $this->get_stored_data('edd_recount_customer_payments_' . $customer->id, array());
     $offset = ($this->step - 1) * $this->per_step;
     $step_items = array_slice($payments, $offset, $this->per_step);
     if (count($step_items) > 0) {
         $pending_total = (double) $this->get_stored_data('edd_stats_customer_pending_total' . $customer->id, 0);
         $step_total = 0;
         $found_payment_ids = $this->get_stored_data('edd_stats_found_payments_' . $customer->id, array());
         foreach ($step_items as $payment) {
             $payment = get_post($payment->ID);
             if (is_null($payment) || is_wp_error($payment) || 'edd_payment' !== $payment->post_type) {
                 $missing_payments = $this->get_stored_data('edd_stats_missing_payments' . $customer->id, array());
                 $missing_payments[] = $payment->ID;
                 $this->store_data('edd_stats_missing_payments' . $customer->id, $missing_payments);
                 continue;
             }
             if ('publish' == $payment->post_status || 'revoked' == $payment->post_status) {
                 $found_payment_ids[] = $payment->ID;
                 $payment_amount = edd_get_payment_amount($payment->ID);
                 $step_total += $payment_amount;
             }
         }
         $updated_total = $pending_total + $step_total;
         $this->store_data('edd_stats_customer_pending_total' . $customer->id, $updated_total);
         $this->store_data('edd_stats_found_payments_' . $customer->id, $found_payment_ids);
         return true;
     }
     return false;
 }
开发者ID:jplhomer,项目名称:Easy-Digital-Downloads,代码行数:40,代码来源:class-edd-tools-recount-single-customer-stats.php

示例3: get_data

 /**
  * Get the Export Data
  *
  * @access public
  * @since 2.5
  * @global object $wpdb Used to query the database using the WordPress
  *   Database API
  * @return array $data The data for the CSV file
  */
 public function get_data()
 {
     $args = array('number' => $this->per_step, 'offset' => $this->per_step * ($this->step - 1), 'orderby' => 'id', 'order' => 'DESC');
     $customers = EDD()->customers->get_customers($args);
     if ($customers) {
         foreach ($customers as $customer) {
             $attached_payment_ids = explode(',', $customer->payment_ids);
             $attached_args = array('post__in' => $attached_payment_ids, 'number' => -1);
             $attached_payments = edd_get_payments($attached_args);
             $unattached_args = array('post__not_in' => $attached_payment_ids, 'number' => -1, 'meta_query' => array(array('key' => '_edd_payment_user_email', 'value' => $customer->email, 'compare' => '=')));
             $unattached_payments = edd_get_payments($unattached_args);
             $payments = array_merge($attached_payments, $unattached_payments);
             $purchase_value = 0.0;
             $purchase_count = 0;
             $payment_ids = array();
             if ($payments) {
                 foreach ($payments as $payment) {
                     if ('publish' == $payment->post_status || 'revoked' == $payment->post_status) {
                         $purchase_value += edd_get_payment_amount($payment->ID);
                         $purchase_count++;
                     }
                     $payment_ids[] = $payment->ID;
                 }
             }
             $payment_ids = implode(',', $payment_ids);
             $customer_update_data = array('purchase_count' => $purchase_count, 'purchase_value' => $purchase_value, 'payment_ids' => $payment_ids);
             $customer_instance = new EDD_Customer($customer->id);
             $customer_instance->update($customer_update_data);
         }
         return true;
     }
     return false;
 }
开发者ID:jplhomer,项目名称:Easy-Digital-Downloads,代码行数:42,代码来源:class-edd-tools-recount-customer-stats.php

示例4: get_data

 /**
  * Get the Export Data
  *
  * @access public
  * @since 2.5
  * @global object $wpdb Used to query the database using the WordPress
  *   Database API
  * @return array $data The data for the CSV file
  */
 public function get_data()
 {
     if ($this->step == 1) {
         $this->delete_data('edd_temp_recount_earnings');
     }
     $total = get_option('edd_temp_recount_earnings', false);
     if (false === $total) {
         $total = (double) 0;
         $this->store_data('edd_temp_recount_earnings', $total);
     }
     $accepted_statuses = apply_filters('edd_recount_accepted_statuses', array('publish', 'revoked'));
     $args = apply_filters('edd_recount_earnings_args', array('number' => $this->per_step, 'page' => $this->step, 'status' => $accepted_statuses, 'fields' => 'ids'));
     $payments = edd_get_payments($args);
     if (!empty($payments)) {
         foreach ($payments as $payment) {
             $total += edd_get_payment_amount($payment);
         }
         if ($total < 0) {
             $totals = 0;
         }
         $total = round($total, edd_currency_decimal_filter());
         $this->store_data('edd_temp_recount_earnings', $total);
         return true;
     }
     update_option('edd_earnings_total', $total);
     set_transient('edd_earnings_total', $total, 86400);
     return false;
 }
开发者ID:jplhomer,项目名称:Easy-Digital-Downloads,代码行数:37,代码来源:class-edd-tools-recount-store-earnings.php

示例5: jp_no_email_free

/**
 * Plugin Name: Easy Digital Downloads - Disable emails on free purchases
 */
function jp_no_email_free($payment_id)
{
    $amount = edd_get_payment_amount($payment_id);
    if (0 == $amount) {
        remove_action('edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 1);
        // This disables customer purchase receipts
        remove_action('edd_admin_sale_notice', 'edd_admin_email_notice', 10, 2);
        // This disables email notices to admins
    }
}
开发者ID:mintplugins,项目名称:library,代码行数:13,代码来源:disable-emails-free-purchases.php

示例6: track_purchase

 /**
  * Create identity and track purchase
  * @param  int $payment_id
  * @return null
  */
 public static function track_purchase($payment_id)
 {
     $user_id = edd_get_payment_user_id($payment_id);
     $uid = EDD_Segment_Identity::get_uid_from_user_id($user_id);
     // Send identity
     $traits = array('name' => edd_email_tag_fullname($payment_id), 'email' => edd_get_payment_user_email($payment_id));
     do_action('edd_segment_identify', $uid, $traits);
     // Track the purchase event
     $props = array('trans_id' => edd_get_payment_transaction_id($payment_id), 'total' => edd_get_payment_amount($payment_id), 'time' => strtotime(edd_get_payment_completed_date($payment_id)));
     do_action('edd_segment_track', $uid, 'Checkout', $props);
 }
开发者ID:SproutApps,项目名称:segment-io,代码行数:16,代码来源:EDD_Hooks.php

示例7: edd_get_gateway_admin_label

/**
 * Returns the admin label for the specified gateway
 *
 * @since 1.0.8.3
 * @param string $gateway Name of the gateway to retrieve a label for
 * @return string Gateway admin label
 */
function edd_get_gateway_admin_label($gateway)
{
    $gateways = edd_get_enabled_payment_gateways();
    $label = isset($gateways[$gateway]) ? $gateways[$gateway]['admin_label'] : $gateway;
    $payment = isset($_GET['id']) ? absint($_GET['id']) : false;
    if ($gateway == 'manual' && $payment) {
        if (edd_get_payment_amount($payment) == 0) {
            $label = __('Free Purchase', 'edd');
        }
    }
    return apply_filters('edd_gateway_admin_label', $label, $gateway);
}
开发者ID:Bragi26,项目名称:Easy-Digital-Downloads,代码行数:19,代码来源:functions.php

示例8: get_data

 /**
  * Get the data being exported
  *
  * @return array $data
  */
 public function get_data()
 {
     global $wpdb;
     $data = array();
     $campaign = $this->campaign;
     $campaign = atcf_get_campaign($campaign);
     $backers = $campaign->backers();
     if (empty($backers)) {
         return $data;
     }
     foreach ($backers as $log) {
         $payment_id = get_post_meta($log->ID, '_edd_log_payment_id', true);
         $payment = get_post($payment_id);
         $payment_meta = edd_get_payment_meta($payment_id);
         $user_info = edd_get_payment_meta_user_info($payment_id);
         $downloads = edd_get_payment_meta_cart_details($payment_id);
         $total = edd_get_payment_amount($payment_id);
         $user_id = isset($user_info['id']) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email'];
         $products = '';
         if ($downloads) {
             foreach ($downloads as $key => $download) {
                 // Download ID
                 $id = isset($payment_meta['cart_details']) ? $download['id'] : $download;
                 // If the download has variable prices, override the default price
                 $price_override = isset($payment_meta['cart_details']) ? $download['price'] : null;
                 $price = edd_get_download_final_price($id, $user_info, $price_override);
                 // Display the Downoad Name
                 $products .= get_the_title($id) . ' - ';
                 if (isset($downloads[$key]['item_number'])) {
                     $price_options = $downloads[$key]['item_number']['options'];
                     if (isset($price_options['price_id'])) {
                         $products .= edd_get_price_option_name($id, $price_options['price_id']) . ' - ';
                     }
                 }
                 $products .= html_entity_decode(edd_currency_filter($price));
                 if ($key != count($downloads) - 1) {
                     $products .= ' / ';
                 }
             }
         }
         if (is_numeric($user_id)) {
             $user = get_userdata($user_id);
         } else {
             $user = false;
         }
         $shipping = isset($payment_meta['shipping']) ? $payment_meta['shipping'] : null;
         $data[] = apply_filters('atcf_csv_cols_values', array('id' => $payment_id, 'email' => $payment_meta['email'], 'first' => $user_info['first_name'], 'last' => $user_info['last_name'], 'shipping' => isset($shipping) ? implode("\n", $shipping) : '', 'products' => $products, 'amount' => html_entity_decode(edd_currency_filter(edd_format_amount($total))), 'tax' => html_entity_decode(edd_payment_tax($payment_id, $payment_meta)), 'discount' => isset($user_info['discount']) && $user_info['discount'] != 'none' ? $user_info['discount'] : __('none', 'atcf'), 'gateway' => edd_get_gateway_admin_label(get_post_meta($payment_id, '_edd_payment_gateway', true)), 'key' => $payment_meta['key'], 'date' => date_i18n(get_option('date_format'), strtotime($payment->post_date)), 'user' => $user ? $user->display_name : __('guest', 'atcf'), 'status' => edd_get_payment_status($payment, true)), $payment_id);
     }
     $data = apply_filters('edd_export_get_data', $data);
     $data = apply_filters('edd_export_get_data_' . $this->export_type, $data);
     return $data;
 }
开发者ID:WilliamJamesDalrympleWest,项目名称:crowdfunding,代码行数:57,代码来源:class-export-campaigns.php

示例9: record_ecommerce360_purchase

 /**
  * Send purchase details to MailChimp's Ecommerce360 extension.
  *
  * @param  integer $payment_id    [description]
  * @return bool
  */
 public function record_ecommerce360_purchase($payment_id = 0)
 {
     // Make sure an API key has been entered
     if (empty($this->key)) {
         return FALSE;
     }
     // Don't record details if we're in test mode
     if (edd_is_test_mode()) {
         return FALSE;
     }
     $payment = edd_get_payment_meta($payment_id);
     $user_info = edd_get_payment_meta_user_info($payment_id);
     $amount = edd_get_payment_amount($payment_id);
     $cart_details = edd_get_payment_meta_cart_details($payment_id);
     $tax = edd_get_payment_tax($payment_id);
     if (is_array($cart_details)) {
         $items = array();
         // Increase purchase count and earnings
         foreach ($cart_details as $index => $download) {
             // Get the categories that this download belongs to, if any
             $post = edd_get_download($download['id']);
             $terms = get_the_terms($download['id'], 'download_category');
             if ($terms && !is_wp_error($terms)) {
                 $categories = array();
                 foreach ($terms as $term) {
                     $categories[] = $term->name;
                 }
                 $category_id = $terms[0]->term_id;
                 $category_name = join(" - ", $categories);
             } else {
                 $category_id = 1;
                 $category_name = 'Download';
             }
             // "bundle" or "default"
             $download_type = edd_get_download_type($download['id']);
             $download['sku'] = edd_get_download_sku($download['id']);
             // if ( 'bundle' == $download_type ) {
             //   $downloads = edd_get_bundled_products( $download_id );
             //   if ( $downloads ) {
             //     foreach ( $downloads as $d_id ) {
             //       # Do something
             //     }
             //   }
             // }
             $item = array('line_num' => $index + 1, 'product_id' => (int) $download['id'], 'product_name' => $download['name'], 'category_id' => $category_id, 'category_name' => $category_name, 'qty' => $download['quantity'], 'cost' => $download['subtotal']);
             if ($download['sku'] !== '-') {
                 $item['sku'] = $download['sku'];
                 // optional, 30 char limit
             }
             $items[] = $item;
         }
         $order = array('id' => (string) $payment_id, 'email' => $user_info['email'], 'total' => $amount, 'store_id' => self::_edd_ec360_get_store_id(), 'store_name' => home_url(), 'items' => $items, 'order_date' => get_the_date('Y-n-j', $payment_id));
         // Set Ecommerce360 variables if they exist
         $campaign_id = get_post_meta($payment_id, '_edd_mc_campaign_id', true);
         $email_id = get_post_meta($payment_id, '_edd_mc_email_id', true);
         if (!empty($campaign_id)) {
             $order['campaign_id'] = $campaign_id;
         }
         if (!empty($email_id)) {
             $order['email_id'] = $email_id;
         }
         if ($tax != 0) {
             $order['tax'] = $tax;
             // double, optional
         }
         // Send to MailChimp
         $options = array('CURLOPT_FOLLOWLOCATION' => false);
         $mailchimp = new EDD_MailChimp_API($this->key, $options);
         try {
             $result = $mailchimp->call('ecomm/order-add', array('order' => $order));
             edd_insert_payment_note($payment_id, __('Order details have been added to MailChimp successfully', 'eddmc'));
         } catch (Exception $e) {
             edd_insert_payment_note($payment_id, __('MailChimp Ecommerce360 Error: ', 'eddmc') . $e->getMessage());
             return FALSE;
         }
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:katzwebservices,项目名称:edd-mail-chimp,代码行数:86,代码来源:class-edd-ecommerce360.php

示例10: edd_wallet_email_tag_value

/**
 * Email template tag: value
 * The total value of the purchase
 *
 * @since       1.0.0
 * @param       int $payment_id
 * @return      string value
 */
function edd_wallet_email_tag_value($payment_id)
{
    if (get_post_type($payment_id) == 'edd_payment') {
        $value = edd_currency_filter(edd_format_amount(edd_get_payment_amount($payment_id)), edd_get_payment_currency_code($payment_id));
    } else {
        $item = edd_wallet()->db->get_customer_wallet_item($payment_id);
        $value = edd_currency_filter(edd_format_amount($item->amount));
    }
    return html_entity_decode($value, ENT_COMPAT, 'UTF-8');
}
开发者ID:easydigitaldownloads,项目名称:edd-wallet,代码行数:18,代码来源:class.edd-email-tags.php

示例11: get_data

 /**
  * Get the Export Data
  *
  * @access public
  * @since 2.4
  * @global object $wpdb Used to query the database using the WordPress
  *   Database API
  * @return array $data The data for the CSV file
  */
 public function get_data()
 {
     global $wpdb;
     $data = array();
     $args = array('number' => 30, 'page' => $this->step, 'status' => $this->status);
     if (!empty($this->start) || !empty($this->end)) {
         $args['date_query'] = array(array('after' => date('Y-n-d H:i:s', strtotime($this->start)), 'before' => date('Y-n-d H:i:s', strtotime($this->end)), 'inclusive' => true));
     }
     //echo json_encode($args ); exit;
     $payments = edd_get_payments($args);
     if ($payments) {
         foreach ($payments as $payment) {
             $payment_meta = edd_get_payment_meta($payment->ID);
             $user_info = edd_get_payment_meta_user_info($payment->ID);
             $downloads = edd_get_payment_meta_cart_details($payment->ID);
             $total = edd_get_payment_amount($payment->ID);
             $user_id = isset($user_info['id']) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email'];
             $products = '';
             $skus = '';
             if ($downloads) {
                 foreach ($downloads as $key => $download) {
                     // Download ID
                     $id = isset($payment_meta['cart_details']) ? $download['id'] : $download;
                     // If the download has variable prices, override the default price
                     $price_override = isset($payment_meta['cart_details']) ? $download['price'] : null;
                     $price = edd_get_download_final_price($id, $user_info, $price_override);
                     // Display the Downoad Name
                     $products .= get_the_title($id) . ' - ';
                     if (edd_use_skus()) {
                         $sku = edd_get_download_sku($id);
                         if (!empty($sku)) {
                             $skus .= $sku;
                         }
                     }
                     if (isset($downloads[$key]['item_number']) && isset($downloads[$key]['item_number']['options'])) {
                         $price_options = $downloads[$key]['item_number']['options'];
                         if (isset($price_options['price_id'])) {
                             $products .= edd_get_price_option_name($id, $price_options['price_id'], $payment->ID) . ' - ';
                         }
                     }
                     $products .= html_entity_decode(edd_currency_filter($price));
                     if ($key != count($downloads) - 1) {
                         $products .= ' / ';
                         if (edd_use_skus()) {
                             $skus .= ' / ';
                         }
                     }
                 }
             }
             if (is_numeric($user_id)) {
                 $user = get_userdata($user_id);
             } else {
                 $user = false;
             }
             $data[] = array('id' => $payment->ID, 'seq_id' => edd_get_payment_number($payment->ID), 'email' => $payment_meta['email'], 'first' => $user_info['first_name'], 'last' => $user_info['last_name'], 'address1' => isset($user_info['address']['line1']) ? $user_info['address']['line1'] : '', 'address2' => isset($user_info['address']['line2']) ? $user_info['address']['line2'] : '', 'city' => isset($user_info['address']['city']) ? $user_info['address']['city'] : '', 'state' => isset($user_info['address']['state']) ? $user_info['address']['state'] : '', 'country' => isset($user_info['address']['country']) ? $user_info['address']['country'] : '', 'zip' => isset($user_info['address']['zip']) ? $user_info['address']['zip'] : '', 'products' => $products, 'skus' => $skus, 'amount' => html_entity_decode(edd_format_amount($total)), 'tax' => html_entity_decode(edd_format_amount(edd_get_payment_tax($payment->ID, $payment_meta))), 'discount' => isset($user_info['discount']) && $user_info['discount'] != 'none' ? $user_info['discount'] : __('none', 'edd'), 'gateway' => edd_get_gateway_admin_label(get_post_meta($payment->ID, '_edd_payment_gateway', true)), 'trans_id' => edd_get_payment_transaction_id($payment->ID), 'key' => $payment_meta['key'], 'date' => $payment->post_date, 'user' => $user ? $user->display_name : __('guest', 'edd'), 'status' => edd_get_payment_status($payment, true));
         }
         $data = apply_filters('edd_export_get_data', $data);
         $data = apply_filters('edd_export_get_data_' . $this->export_type, $data);
         return $data;
     }
     return false;
 }
开发者ID:nguyenthai2010,项目名称:ngocshop,代码行数:71,代码来源:class-batch-export-payments.php

示例12: edd_payment_amount

/**
 * Get the fully formatted payment amount. The payment amount is retrieved using
 * edd_get_payment_amount() and is then sent through edd_currency_filter() and
 * edd_format_amount() to format the amount correctly.
 *
 * @since 1.4
 * @param int $payment_id Payment ID
 * @return string $amount Fully formatted payment amount
 */
function edd_payment_amount($payment_id = 0)
{
    $amount = edd_get_payment_amount($payment_id);
    return edd_currency_filter(edd_format_amount($amount), edd_get_payment_currency_code($payment_id));
}
开发者ID:ramiy,项目名称:Easy-Digital-Downloads,代码行数:14,代码来源:functions.php

示例13: edd_userpro_embed_profile_fields

function edd_userpro_embed_profile_fields($hook_args)
{
    if (!current_user_can('edit_user', $hook_args['user_id'])) {
        return;
    }
    echo '<div class="userpro-section userpro-column userpro-collapsible-1 userpro-collapsed-1">' . __('Purchase History', 'edd-userpro-embed') . '</div>';
    echo '<div class="userpro-field userpro-field-edd-purchase-history userpro-field-view" data-key="edd-purchase-history">';
    $purchases = edd_get_users_purchases($hook_args['user_id'], 99999, true, 'any');
    if ($purchases) {
        do_action('edd_before_purchase_history');
        ?>
		<table id="edd_user_history">
			<thead>
				<tr class="edd_purchase_row">
					<?php 
        do_action('edd_purchase_history_header_before');
        ?>
					<th class="edd_purchase_id"><?php 
        _e('ID', 'easy-digital-downloads');
        ?>
</th>
					<th class="edd_purchase_date"><?php 
        _e('Date', 'easy-digital-downloads');
        ?>
</th>
					<th class="edd_purchase_amount"><?php 
        _e('Amount', 'easy-digital-downloads');
        ?>
</th>
					<th class="edd_purchase_details"><?php 
        _e('Details', 'easy-digital-downloads');
        ?>
</th>
					<?php 
        do_action('edd_purchase_history_header_after');
        ?>
				</tr>
			</thead>
			<?php 
        foreach ($purchases as $post) {
            setup_postdata($post);
            ?>
				<?php 
            $purchase_data = edd_get_payment_meta($post->ID);
            ?>
				<tr class="edd_purchase_row">
					<?php 
            do_action('edd_purchase_history_row_start', $post->ID, $purchase_data);
            ?>
					<td class="edd_purchase_id">#<?php 
            echo edd_get_payment_number($post->ID);
            ?>
</td>
					<td class="edd_purchase_date"><?php 
            echo date_i18n(get_option('date_format'), strtotime(get_post_field('post_date', $post->ID)));
            ?>
</td>
					<td class="edd_purchase_amount">
						<span class="edd_purchase_amount"><?php 
            echo edd_currency_filter(edd_format_amount(edd_get_payment_amount($post->ID)));
            ?>
</span>
					</td>
					<td class="edd_purchase_details">
						<?php 
            if ($post->post_status != 'publish') {
                ?>
						<span class="edd_purchase_status <?php 
                echo $post->post_status;
                ?>
"><?php 
                echo edd_get_payment_status($post, true);
                ?>
</span>
						<a href="<?php 
                echo esc_url(add_query_arg('payment_key', edd_get_payment_key($post->ID), edd_get_success_page_uri()));
                ?>
">&raquo;</a>
						<?php 
            } else {
                ?>
						<a href="<?php 
                echo esc_url(add_query_arg('payment_key', edd_get_payment_key($post->ID), edd_get_success_page_uri()));
                ?>
"><?php 
                _e('View Details', 'edd-userpro-embed');
                ?>
</a>
						<?php 
            }
            ?>
					</td>
					<?php 
            do_action('edd_purchase_history_row_end', $post->ID, $purchase_data);
            ?>
				</tr>
			<?php 
        }
        ?>
		</table>
//.........这里部分代码省略.........
开发者ID:easydigitaldownloads,项目名称:EDD-UserPro-Embed,代码行数:101,代码来源:profile.php

示例14: edd_get_sale_notification_body_content

/**
 * Sale Notification Template Body
 *
 * @since 1.7
 * @author Daniel J Griffiths
 * @param int $payment_id Payment ID
 * @param array $payment_data Payment Data
 * @return string $email_body Body of the email
 */
function edd_get_sale_notification_body_content($payment_id = 0, $payment_data = array())
{
    global $edd_options;
    $user_info = maybe_unserialize($payment_data['user_info']);
    $email = edd_get_payment_user_email($payment_id);
    if (isset($user_info['id']) && $user_info['id'] > 0) {
        $user_data = get_userdata($user_info['id']);
        $name = $user_data->display_name;
    } elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) {
        $name = $user_info['first_name'] . ' ' . $user_info['last_name'];
    } else {
        $name = $email;
    }
    $download_list = '';
    $downloads = maybe_unserialize($payment_data['downloads']);
    if (is_array($downloads)) {
        foreach ($downloads as $download) {
            $id = isset($payment_data['cart_details']) ? $download['id'] : $download;
            $title = get_the_title($id);
            if (isset($download['options'])) {
                if (isset($download['options']['price_id'])) {
                    $title .= ' - ' . edd_get_price_option_name($id, $download['options']['price_id'], $payment_id);
                }
            }
            $download_list .= html_entity_decode($title, ENT_COMPAT, 'UTF-8') . "\n";
        }
    }
    $gateway = edd_get_gateway_admin_label(get_post_meta($payment_id, '_edd_payment_gateway', true));
    $default_email_body = __('Hello', 'edd') . "\n\n" . sprintf(__('A %s purchase has been made', 'edd'), edd_get_label_plural()) . ".\n\n";
    $default_email_body .= sprintf(__('%s sold:', 'edd'), edd_get_label_plural()) . "\n\n";
    $default_email_body .= $download_list . "\n\n";
    $default_email_body .= __('Purchased by: ', 'edd') . " " . html_entity_decode($name, ENT_COMPAT, 'UTF-8') . "\n";
    $default_email_body .= __('Amount: ', 'edd') . " " . html_entity_decode(edd_currency_filter(edd_format_amount(edd_get_payment_amount($payment_id))), ENT_COMPAT, 'UTF-8') . "\n";
    $default_email_body .= __('Payment Method: ', 'edd') . " " . $gateway . "\n\n";
    $default_email_body .= __('Thank you', 'edd');
    $email = isset($edd_options['sale_notification']) ? stripslashes($edd_options['sale_notification']) : $default_email_body;
    //$email_body = edd_email_template_tags( $email, $payment_data, $payment_id, true );
    $email_body = edd_do_email_tags($email, $payment_id);
    return apply_filters('edd_sale_notification', wpautop($email_body), $payment_id, $payment_data);
}
开发者ID:Bragi26,项目名称:Easy-Digital-Downloads,代码行数:49,代码来源:template.php

示例15: payments_data

 /**
  * Retrieve all the data for all the payments
  *
  * @access public
  * @since 1.4
  * @return array $payment_data Array of all the data for the payments
  */
 public function payments_data()
 {
     $payments_data = array();
     if (isset($_GET['paged'])) {
         $page = $_GET['paged'];
     } else {
         $page = 1;
     }
     $per_page = $this->per_page;
     $mode = edd_is_test_mode() ? 'test' : 'live';
     $orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'ID';
     $order = isset($_GET['order']) ? $_GET['order'] : 'DESC';
     $order_inverse = $order == 'DESC' ? 'ASC' : 'DESC';
     $order_class = strtolower($order_inverse);
     $user = isset($_GET['user']) ? $_GET['user'] : null;
     $status = isset($_GET['status']) ? $_GET['status'] : 'any';
     $meta_key = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
     $year = isset($_GET['year']) ? $_GET['year'] : null;
     $month = isset($_GET['m']) ? $_GET['m'] : null;
     $day = isset($_GET['day']) ? $_GET['day'] : null;
     $search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
     $payments = edd_get_payments(array('number' => $per_page, 'page' => isset($_GET['paged']) ? $_GET['paged'] : null, 'mode' => $mode, 'orderby' => $orderby, 'order' => $order, 'user' => $user, 'status' => $status, 'meta_key' => $meta_key, 'year' => $year, 'month' => $month, 'day' => $day, 's' => $search));
     if ($payments) {
         foreach ($payments as $payment) {
             $user_info = edd_get_payment_meta_user_info($payment->ID);
             $cart_details = edd_get_payment_meta_cart_details($payment->ID);
             $user_id = isset($user_info['ID']) && $user_info['ID'] != -1 ? $user_info['ID'] : $user_info['email'];
             $payments_data[] = array('ID' => $payment->ID, 'email' => edd_get_payment_user_email($payment->ID), 'products' => $cart_details, 'amount' => edd_get_payment_amount($payment->ID), 'date' => $payment->post_date, 'user' => $user_id, 'status' => $payment->post_status);
         }
     }
     return $payments_data;
 }
开发者ID:bangtienmanh,项目名称:Easy-Digital-Downloads,代码行数:39,代码来源:class-payments-table.php


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