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


PHP MemberOrder::getMembershipLevel方法代码示例

本文整理汇总了PHP中MemberOrder::getMembershipLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP MemberOrder::getMembershipLevel方法的具体用法?PHP MemberOrder::getMembershipLevel怎么用?PHP MemberOrder::getMembershipLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemberOrder的用法示例。


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

示例1: pmpro_shortcode_account


//.........这里部分代码省略.........
		<div id="pmpro_account-invoices" class="pmpro_box">
			<h3><?php 
            _e("Past Invoices", "pmpro");
            ?>
</h3>
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<thead>
					<tr>
						<th><?php 
            _e("Date", "pmpro");
            ?>
</th>
						<th><?php 
            _e("Level", "pmpro");
            ?>
</th>
						<th><?php 
            _e("Amount", "pmpro");
            ?>
</th>
					</tr>
				</thead>
				<tbody>
				<?php 
            $count = 0;
            foreach ($invoices as $invoice) {
                if ($count++ > 4) {
                    break;
                }
                //get an member order object
                $invoice_id = $invoice->id;
                $invoice = new MemberOrder();
                $invoice->getMemberOrderByID($invoice_id);
                $invoice->getMembershipLevel();
                ?>
						<tr id="pmpro_account-invoice-<?php 
                echo $invoice->code;
                ?>
">
							<td><a href="<?php 
                echo pmpro_url("invoice", "?invoice=" . $invoice->code);
                ?>
"><?php 
                echo date(get_option("date_format"), $invoice->timestamp);
                ?>
</td>
							<td><?php 
                echo $invoice->membership_level->name;
                ?>
</td>
							<td><?php 
                echo pmpro_formatPrice($invoice->total);
                ?>
</td>
						</tr>
						<?php 
            }
            ?>
				</tbody>
			</table>						
			<?php 
            if ($count == 6) {
                ?>
				<div class="pmpro_actionlinks"><a href="<?php 
                echo pmpro_url("invoice");
                ?>
开发者ID:mathieuhays,项目名称:paid-memberships-pro,代码行数:67,代码来源:pmpro_account.php

示例2: MemberOrder

 /**
  * Review and Confirmation code.
  *
  * @since 1.8
  */
 static function pmpro_checkout_confirmed($pmpro_confirmed)
 {
     global $pmpro_msg, $pmpro_msgt, $pmpro_level, $current_user, $pmpro_review, $pmpro_paypal_token, $discount_code, $bemail;
     //PayPal Express Call Backs
     if (!empty($_REQUEST['review'])) {
         if (!empty($_REQUEST['PayerID'])) {
             $_SESSION['payer_id'] = $_REQUEST['PayerID'];
         }
         if (!empty($_REQUEST['paymentAmount'])) {
             $_SESSION['paymentAmount'] = $_REQUEST['paymentAmount'];
         }
         if (!empty($_REQUEST['currencyCodeType'])) {
             $_SESSION['currCodeType'] = $_REQUEST['currencyCodeType'];
         }
         if (!empty($_REQUEST['paymentType'])) {
             $_SESSION['paymentType'] = $_REQUEST['paymentType'];
         }
         $morder = new MemberOrder();
         $morder->getMemberOrderByPayPalToken($_REQUEST['token']);
         $morder->Token = $morder->paypal_token;
         $pmpro_paypal_token = $morder->paypal_token;
         if ($morder->Token) {
             if ($morder->Gateway->getExpressCheckoutDetails($morder)) {
                 $pmpro_review = true;
             } else {
                 $pmpro_msg = $morder->error;
                 $pmpro_msgt = "pmpro_error";
             }
         } else {
             $pmpro_msg = __("The PayPal Token was lost.", "pmpro");
             $pmpro_msgt = "pmpro_error";
         }
     } elseif (!empty($_REQUEST['confirm'])) {
         $morder = new MemberOrder();
         $morder->getMemberOrderByPayPalToken($_REQUEST['token']);
         $morder->Token = $morder->paypal_token;
         $pmpro_paypal_token = $morder->paypal_token;
         if ($morder->Token) {
             //set up values
             $morder->membership_id = $pmpro_level->id;
             $morder->membership_name = $pmpro_level->name;
             $morder->discount_code = $discount_code;
             $morder->InitialPayment = $pmpro_level->initial_payment;
             $morder->PaymentAmount = $pmpro_level->billing_amount;
             $morder->ProfileStartDate = date("Y-m-d") . "T0:0:0";
             $morder->BillingPeriod = $pmpro_level->cycle_period;
             $morder->BillingFrequency = $pmpro_level->cycle_number;
             $morder->Email = $bemail;
             //set up level var
             $morder->getMembershipLevel();
             $morder->membership_level = apply_filters("pmpro_checkout_level", $morder->membership_level);
             //tax
             $morder->subtotal = $morder->InitialPayment;
             $morder->getTax();
             if ($pmpro_level->billing_limit) {
                 $morder->TotalBillingCycles = $pmpro_level->billing_limit;
             }
             if (pmpro_isLevelTrial($pmpro_level)) {
                 $morder->TrialBillingPeriod = $pmpro_level->cycle_period;
                 $morder->TrialBillingFrequency = $pmpro_level->cycle_number;
                 $morder->TrialBillingCycles = $pmpro_level->trial_limit;
                 $morder->TrialAmount = $pmpro_level->trial_amount;
             }
             if ($morder->confirm()) {
                 $pmpro_confirmed = true;
             } else {
                 $pmpro_msg = $morder->error;
                 $pmpro_msgt = "pmpro_error";
             }
         } else {
             $pmpro_msg = __("The PayPal Token was lost.", "pmpro");
             $pmpro_msgt = "pmpro_error";
         }
     }
     if (!empty($morder)) {
         return array("pmpro_confirmed" => $pmpro_confirmed, "morder" => $morder);
     } else {
         return $pmpro_confirmed;
     }
 }
开发者ID:javierdlahoz,项目名称:dcbia-wp,代码行数:85,代码来源:class.pmprogateway_paypalexpress.php

示例3: inslog

    //update membership
    if (pmpro_insChangeMembershipLevel($txn_id, $morder)) {
        inslog("Checkout processed (" . $morder->code . ") success!");
    } else {
        inslog("ERROR: Couldn't change level for order (" . $morder->code . ").");
    }
    pmpro_twocheckoutExit(pmpro_url("confirmation", "?level=" . $morder->membership_level->id));
}
// Recurring Payment Success (recurring installment success and recurring is true)
if ($message_type == 'RECURRING_INSTALLMENT_SUCCESS') {
    //is this a first payment?
    $last_subscr_order = new MemberOrder();
    if ($last_subscr_order->getLastMemberOrderBySubscriptionTransactionID($txn_id) == false) {
        //first payment, get order
        $morder = new MemberOrder($order_id);
        $morder->getMembershipLevel();
        $morder->getUser();
        //update membership
        if (pmpro_insChangeMembershipLevel($txn_id, $morder)) {
            inslog("Checkout processed (" . $morder->code . ") success!");
        } else {
            inslog("ERROR: Couldn't change level for order (" . $morder->code . ").");
        }
    } else {
        pmpro_insSaveOrder($txn_id, $last_subscr_order);
    }
    pmpro_twocheckoutExit();
}
// Recurring Payment Failed (recurring installment failed and recurring is true)
if ($message_type == 'RECURRING_INSTALLMENT_FAILED' && $recurring) {
    //is this a first payment?
开发者ID:Seravo,项目名称:wp-paid-subscriptions,代码行数:31,代码来源:twocheckout-ins.php

示例4: foreach

if (!empty($extra_columns)) {
    foreach ($extra_columns as $heading => $callback) {
        $csvoutput .= "," . $heading;
    }
}
$csvoutput .= "\n";
//output
echo $csvoutput;
$csvoutput = "";
if ($order_ids) {
    foreach ($order_ids as $order_id) {
        $order = new MemberOrder();
        $order->nogateway = true;
        $order->getMemberOrderByID($order_id);
        $user = get_userdata($order->user_id);
        $level = $order->getMembershipLevel();
        $sqlQuery = "SELECT c.id, c.code FROM {$wpdb->pmpro_discount_codes_uses} cu LEFT JOIN {$wpdb->pmpro_discount_codes} c ON cu.code_id = c.id WHERE cu.order_id = '" . $order_id . "' LIMIT 1";
        $discount_code = $wpdb->get_row($sqlQuery);
        //default columns
        if (!empty($default_columns)) {
            $count = 0;
            foreach ($default_columns as $col) {
                //add comma after the first item
                $count++;
                if ($count > 1) {
                    $csvoutput .= ",";
                }
                //checking $object->property. note the double $$
                if (!empty($col[2]) && isset(${$col}[0]->{$col}[1]->{$col}[2])) {
                    $csvoutput .= pmpro_enclose(${$col}[0]->{$col}[1]->{$col}[2]);
                } elseif (!empty(${$col}[0]->{$col}[1])) {
开发者ID:danielcoats,项目名称:schoolpress,代码行数:31,代码来源:orders-csv.php

示例5: foreach

			<div class="row">
				<div class="col-md-4"><h6>Date</h6></div>
				<div class="col-md-4"><h6>Level</h6></div>
				<div class="col-md-4"><h6>Amount</h6></div>
			</div>
			<?php 
        $count = 0;
        foreach ($invoices as $invoice) {
            ?>
					<div class="row">
						<?php 
            //get an member order object
            $invoice_id = $invoice->id;
            $invoice = new MemberOrder();
            $invoice->getMemberOrderByID($invoice_id);
            $invoice->getMembershipLevel();
            ?>
						<div class="col-md-4">
							<a href="<?php 
            echo pmpro_url("invoice", "?invoice=" . $invoice->code);
            ?>
"><?php 
            echo date(get_option("date_format"), $invoice->timestamp);
            ?>
</a>
						</div>
						<div class="col-md-4">
							<?php 
            echo $invoice->membership_level->name;
            ?>
						</div>
开发者ID:ivan-shulev,项目名称:despreneur-academy,代码行数:31,代码来源:page-settings.php

示例6: pmpro_affiliates_no_order_checkout

function pmpro_affiliates_no_order_checkout($user_id)
{
    global $pmpro_affiliates_saved_order;
    //if an order was added, we're good already
    if ($pmpro_affiliates_saved_order) {
        return;
    }
    //get some info
    $user = get_userdata($user_id);
    $pmpro_level = pmpro_getMembershipLevelForUser($user_id);
    //setup an order
    $morder = new MemberOrder();
    $morder->membership_id = $pmpro_level->id;
    $morder->membership_name = $pmpro_level->name;
    $morder->InitialPayment = 0;
    $morder->user_id = $user_id;
    $morder->Email = $user->user_email;
    $morder->gateway = "check";
    $morder->Gateway = NULL;
    $morder->getMembershipLevel();
    //now pass through the function above
    return pmpro_affiliates_pmpro_added_order($morder, true);
    //will create an order if there is an affiliate id
}
开发者ID:datalynk,项目名称:pmpro-affiliates,代码行数:24,代码来源:pmpro-affiliates.php


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