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


PHP pmpro_getLevelCost函数代码示例

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


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

示例1: pmpro_shortcode_account


//.........这里部分代码省略.........
</a>
									<?php 
            }
            ?>
									
									<?php 
            //To do: Only show CHANGE link if this level is in a group that has upgrade/downgrade rules
            if (count($pmpro_levels) > 1 && !defined("PMPRO_DEFAULT_LEVEL")) {
                ?>
										<a href="<?php 
                echo pmpro_url("levels");
                ?>
"><?php 
                _e("Change", "pmpro");
                ?>
</a>
									<?php 
            }
            ?>
									<a href="<?php 
            echo pmpro_url("cancel", "?level=" . $current_user->membership_level->id);
            ?>
"><?php 
            _e("Cancel", "pmpro");
            ?>
</a>
									<?php 
            do_action("pmpro_member_action_links_after");
            ?>
								</div> <!-- end pmpro_actionlinks -->
							</td>
							<td class="pmpro_account-membership-levelfee">
								<p><?php 
            echo pmpro_getLevelCost($level, true, true);
            ?>
</p>
							</td>
							<td class="pmpro_account-membership-expiration">
							<?php 
            if ($current_user->membership_level->enddate) {
                echo date(get_option('date_format'), $current_user->membership_level->enddate);
            } else {
                echo "---";
            }
            ?>
							</td>
						</tr>
					</tbody>
				</table>
				<?php 
            //Todo: If there are multiple levels defined that aren't all in the same group defined as upgrades/downgrades
            ?>
				<div class="pmpro_actionlinks">
					<a href="<?php 
            echo pmpro_url("levels");
            ?>
"><?php 
            _e("View all Membership Options", "pmpro");
            ?>
</a>
				</div>

			</div> <!-- end pmpro_account-membership -->
		<?php 
        }
        ?>
开发者ID:mathieuhays,项目名称:paid-memberships-pro,代码行数:67,代码来源:pmpro_account.php

示例2: __

    if ($current_level == $level) {
        ?>
 active<?php 
    }
    ?>
">
		<td><?php 
    echo $current_level ? "<strong>{$level->name}</strong>" : $level->name;
    ?>
</td>
		<td>
			<?php 
    if (pmpro_isLevelFree($level)) {
        $cost_text = "<strong>" . __("Free", "pmpro") . "</strong>";
    } else {
        $cost_text = pmpro_getLevelCost($level, true, true);
    }
    $expiration_text = pmpro_getLevelExpiration($level);
    if (!empty($cost_text) && !empty($expiration_text)) {
        echo $cost_text . "<br />" . $expiration_text;
    } elseif (!empty($cost_text)) {
        echo $cost_text;
    } elseif (!empty($expiration_text)) {
        echo $expiration_text;
    }
    ?>
		</td>
		<td>
		<?php 
    if (empty($current_user->membership_level->ID)) {
        ?>
开发者ID:MediaPreneur,项目名称:paid-memberships-pro,代码行数:31,代码来源:levels.php

示例3: apply_filters

    echo apply_filters("the_content", stripslashes($pmpro_level->description));
}
?>

				<div id="pmpro_level_cost">
					<?php 
if ($discount_code && pmpro_checkDiscountCode($discount_code)) {
    ?>
						<?php 
    printf(__('<p class="pmpro_level_discount_applied">The <strong>%s</strong> code has been applied to your order.</p>', 'pmpro'), $discount_code);
    ?>
					<?php 
}
?>
					<?php 
echo wpautop(pmpro_getLevelCost($pmpro_level));
?>
					<?php 
echo wpautop(pmpro_getLevelExpiration($pmpro_level));
?>
				</div>

				<?php 
do_action("pmpro_checkout_after_level_cost");
?>

				<?php 
if ($pmpro_show_discount_code) {
    ?>

					<?php 
开发者ID:mathieuhays,项目名称:paid-memberships-pro,代码行数:31,代码来源:checkout.php

示例4: sendCheckoutAdminEmail

		function sendCheckoutAdminEmail($user = NULL, $invoice = NULL)
		{
			global $wpdb, $current_user, $pmpro_currency_symbol;
			if(!$user)
				$user = $current_user;
			
			if(!$user)
				return false;
			
			//check settings
			$send = pmpro_getOption("email_admin_checkout");
			if(empty($send))
				return true;	//didn't send, but we also don't want to indicate failure because the settings say to not send
			
			$this->email = get_bloginfo("admin_email");
			$this->subject = "Member Checkout for " . $user->membership_level->name . " at " . get_option("blogname");	
			
			$this->data = array(
								"subject" => $this->subject, 
								"name" => $user->display_name, 
								"user_login" => $user->user_login,
								"sitename" => get_option("blogname"),
								"siteemail" => pmpro_getOption("from_email"),
								"membership_level_name" => $user->membership_level->name,
								"membership_cost" => pmpro_getLevelCost($user->membership_level),								
								"login_link" => pmpro_url("account"),
								"display_name" => $user->display_name,
								"user_email" => $user->user_email,0								
							);						
			
			if($invoice)
			{									
				if($invoice->gateway == "paypalexpress")
					$this->template = "checkout_express_admin";
				elseif($invoice->gateway == "check")
					$this->template = "checkout_check_admin";					
				elseif(pmpro_isLevelTrial($user->membership_level))
					$this->template = "checkout_trial_admin";
				else
					$this->template = "checkout_paid_admin";
				$this->data["invoice_id"] = $invoice->code;
				$this->data["invoice_total"] = $pmpro_currency_symbol . number_format($invoice->total, 2);
				$this->data["invoice_date"] = date(get_option('date_format'), $invoice->timestamp);
				$this->data["billing_name"] = $invoice->billing->name;
				$this->data["billing_street"] = $invoice->billing->street;
				$this->data["billing_city"] = $invoice->billing->city;
				$this->data["billing_state"] = $invoice->billing->state;
				$this->data["billing_zip"] = $invoice->billing->zip;
				$this->data["billing_country"] = $invoice->billing->country;
				$this->data["billing_phone"] = $invoice->billing->phone;
				$this->data["cardtype"] = $invoice->cardtype;
				$this->data["accountnumber"] = hideCardNumber($invoice->accountnumber);
				$this->data["expirationmonth"] = $invoice->expirationmonth;
				$this->data["expirationyear"] = $invoice->expirationyear;
				
				if($invoice->getDiscountCode())
					$this->data["discount_code"] = "<p>Discount Code: " . $invoice->discount_code->code . "</p>\n";
				else
					$this->data["discount_code"] = "";
			}
			elseif(pmpro_isLevelFree($user->membership_level))
			{
				$this->template = "checkout_free_admin";		
				global $discount_code;
				if(!empty($discount_code))
					$this->data["discount_code"] = "<p>Discount Code: " . $discount_code . "</p>\n";		
				else
					$this->data["discount_code"] = "";	
			}						
			else
			{
				$this->template = "checkout_freetrial_admin";
				$this->data["discount_code"] = "";
			}
			
			$enddate = $wpdb->get_var("SELECT UNIX_TIMESTAMP(enddate) FROM $wpdb->pmpro_memberships_users WHERE user_id = '" . $user->ID . "' AND status = 'active' LIMIT 1");
			if($enddate)
				$this->data["membership_expiration"] = "<p>This membership will expire on " . date(get_option('date_format'), $enddate) . ".</p>\n";
			else
				$this->data["membership_expiration"] = "";
			
			return $this->sendEmail();
		}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:83,代码来源:class.pmproemail.php

示例5: pmpro_membership_level_profile_fields

function pmpro_membership_level_profile_fields($user)
{
    global $current_user;
    $membership_level_capability = apply_filters("pmpro_edit_member_capability", "manage_options");
    if (!current_user_can($membership_level_capability)) {
        return false;
    }
    global $wpdb;
    /*$user->membership_level = $wpdb->get_row("SELECT l.id AS ID, l.name AS name
    		FROM {$wpdb->pmpro_membership_levels} AS l
    		JOIN {$wpdb->pmpro_memberships_users} AS mu ON (l.id = mu.membership_id)
    		WHERE mu.user_id = " . $user->ID . "
    		LIMIT 1");*/
    $user->membership_level = pmpro_getMembershipLevelForUser($user->ID);
    $levels = $wpdb->get_results("SELECT * FROM {$wpdb->pmpro_membership_levels}", OBJECT);
    if (!$levels) {
        return "";
    }
    ?>
<h3><?php 
    _e("Membership Level", "pmpro");
    ?>
</h3>
<table class="form-table">
    <?php 
    $show_membership_level = true;
    $show_membership_level = apply_filters("pmpro_profile_show_membership_level", $show_membership_level, $user);
    if ($show_membership_level) {
        ?>
		<tr>
			<th><label for="membership_level"><?php 
        _e("Current Level", "pmpro");
        ?>
</label></th>
			<td>
				<select name="membership_level">
					<option value="" <?php 
        if (empty($user->membership_level->ID)) {
            ?>
selected="selected"<?php 
        }
        ?>
>-- <?php 
        _e("None", "pmpro");
        ?>
 --</option>
				<?php 
        foreach ($levels as $level) {
            ?>
					<option value="<?php 
            echo $level->id;
            ?>
" <?php 
            selected($level->id, isset($user->membership_level->ID) ? $user->membership_level->ID : 0);
            ?>
><?php 
            echo $level->name;
            ?>
</option>
				<?php 
        }
        ?>
				</select>
                <span id="current_level_cost">
                <?php 
        $membership_values = pmpro_getMembershipLevelForUser($user->ID);
        if (empty($membership_values) || pmpro_isLevelFree($membership_values)) {
            ?>
                    <?php 
            _e("Not paying.", "pmpro");
            ?>
                <?php 
        } else {
            //we tweak the initial payment here so the text here effectively shows the recurring amount
            $membership_values->initial_payment = $membership_values->billing_amount;
            echo pmpro_getLevelCost($membership_values, true, true);
        }
        ?>
                </span>
                <p id="cancel_description" class="description hidden"><?php 
        _e("This will not change the subscription at the gateway unless the 'Cancel' checkbox is selected below.", "pmpro");
        ?>
</p>
            </td>
		</tr>
		<?php 
    }
    $show_expiration = true;
    $show_expiration = apply_filters("pmpro_profile_show_expiration", $show_expiration, $user);
    if ($show_expiration) {
        //is there an end date?
        $user->membership_level = pmpro_getMembershipLevelForUser($user->ID);
        $end_date = !empty($user->membership_level->enddate);
        //some vars for the dates
        $current_day = date("j");
        if ($end_date) {
            $selected_expires_day = date("j", $user->membership_level->enddate);
        } else {
            $selected_expires_day = $current_day;
        }
//.........这里部分代码省略.........
开发者ID:nwmcinc,项目名称:paid-memberships-pro,代码行数:101,代码来源:profile.php

示例6: pmpro_url

						<a href="<?php 
        echo pmpro_url("levels");
        ?>
"><?php 
        _e("View all Membership Options", "pmpro");
        ?>
</a>
					</div>
				</div>
				<div class="col-md-4">
					<h6>Billing</h6>
					<?php 
        $level = $current_user->membership_level;
        ?>
					<p><?php 
        echo pmpro_getLevelCost($level, true, true);
        ?>
</p>
					<a href="<?php 
        echo pmpro_url("billing", "");
        ?>
"><?php 
        _e("Update Billing Info", "pmpro");
        ?>
</a>
				</div>
				<div class="col-md-4">
					<h6>Expiration</h6>
					<?php 
        if ($current_user->membership_level->enddate) {
            echo date(get_option('date_format'), $current_user->membership_level->enddate);
开发者ID:ivan-shulev,项目名称:despreneur-academy,代码行数:31,代码来源:page-settings.php

示例7: _e

		jQuery('#other_discount_code_p').html('<a id="other_discount_code_a" href="javascript:void(0);"><?php 
_e('Click here to change your discount code', 'pmpro');
?>
</a>.');
		jQuery('#other_discount_code_p').show();
		
		jQuery('#other_discount_code_a').click(function() {
			jQuery('#other_discount_code_tr').show();
			jQuery('#other_discount_code_p').hide();			
		});
		
		jQuery('#pmpro_level_cost').html('<p><?php 
printf(__('The <strong>%s</strong> code has been applied to your order.', 'pmpro'), $discount_code);
?>
</p><p><?php 
echo pmpro_no_quotes(pmpro_getLevelCost($code_level), array('"', "'", "\n", "\r"));
echo pmpro_no_quotes(pmpro_getLevelExpiration($code_level), array('"', "'", "\n", "\r"));
?>
</p>');
		
		<?php 
//tell gateway javascripts whether or not to fire (e.g. no Stripe on free levels)
if (pmpro_isLevelFree($code_level)) {
    ?>
				pmpro_require_billing = false;
			<?php 
} else {
    ?>
				pmpro_require_billing = true;
			<?php 
}
开发者ID:AmpleTech,项目名称:paid-memberships-pro,代码行数:31,代码来源:applydiscountcode.php

示例8: _e

"><?php 
        echo $level->name;
        ?>
</a></td>
			<td>
				<?php 
        if (pmpro_isLevelFree($level)) {
            ?>
					<?php 
            _e('FREE', 'pmpro');
            ?>
				<?php 
        } else {
            ?>
					<?php 
            echo str_replace('The price for membership is', '', pmpro_getLevelCost($level));
            ?>
				<?php 
        }
        ?>
			</td>
			<td>
				<?php 
        if (!pmpro_isLevelExpiring($level)) {
            ?>
					--
				<?php 
        } else {
            ?>
		
					<?php 
开发者ID:Buooy,项目名称:stewaard-membership,代码行数:31,代码来源:membershiplevels.php

示例9: sendCheckoutAdminEmail

 function sendCheckoutAdminEmail($user = NULL, $invoice = NULL)
 {
     global $wpdb, $current_user;
     if (!$user) {
         $user = $current_user;
     }
     if (!$user) {
         return false;
     }
     //check settings
     $send = pmpro_getOption("email_admin_checkout");
     if (empty($send)) {
         return true;
     }
     //didn't send, but we also don't want to indicate failure because the settings say to not send
     $this->email = get_bloginfo("admin_email");
     $this->subject = sprintf(__("Member Checkout for %s at %s", "pmpro"), $user->membership_level->name, get_option("blogname"));
     $this->data = array("subject" => $this->subject, "name" => $user->display_name, "user_login" => $user->user_login, "sitename" => get_option("blogname"), "siteemail" => pmpro_getOption("from_email"), "membership_id" => $user->membership_level->id, "membership_level_name" => $user->membership_level->name, "membership_cost" => pmpro_getLevelCost($user->membership_level), "login_link" => wp_login_url(pmpro_url("account")), "display_name" => $user->display_name, "user_email" => $user->user_email);
     if (!empty($invoice) && !pmpro_isLevelFree($user->membership_level)) {
         if ($invoice->gateway == "paypalexpress") {
             $this->template = "checkout_express_admin";
         } elseif ($invoice->gateway == "check") {
             $this->template = "checkout_check_admin";
         } elseif (pmpro_isLevelTrial($user->membership_level)) {
             $this->template = "checkout_trial_admin";
         } else {
             $this->template = "checkout_paid_admin";
         }
         $this->data["invoice_id"] = $invoice->code;
         $this->data["invoice_total"] = pmpro_formatPrice($invoice->total);
         $this->data["invoice_date"] = date_i18n(get_option('date_format'), $invoice->timestamp);
         $this->data["billing_name"] = $invoice->billing->name;
         $this->data["billing_street"] = $invoice->billing->street;
         $this->data["billing_city"] = $invoice->billing->city;
         $this->data["billing_state"] = $invoice->billing->state;
         $this->data["billing_zip"] = $invoice->billing->zip;
         $this->data["billing_country"] = $invoice->billing->country;
         $this->data["billing_phone"] = $invoice->billing->phone;
         $this->data["cardtype"] = $invoice->cardtype;
         $this->data["accountnumber"] = hideCardNumber($invoice->accountnumber);
         $this->data["expirationmonth"] = $invoice->expirationmonth;
         $this->data["expirationyear"] = $invoice->expirationyear;
         $this->data["billing_address"] = pmpro_formatAddress($invoice->billing->name, $invoice->billing->street, "", $invoice->billing->city, $invoice->billing->state, $invoice->billing->zip, $invoice->billing->country, $invoice->billing->phone);
         if ($invoice->getDiscountCode()) {
             $this->data["discount_code"] = "<p>" . __("Discount Code", "pmpro") . ": " . $invoice->discount_code->code . "</p>\n";
         } else {
             $this->data["discount_code"] = "";
         }
     } elseif (pmpro_isLevelFree($user->membership_level)) {
         $this->template = "checkout_free_admin";
         global $discount_code;
         if (!empty($discount_code)) {
             $this->data["discount_code"] = "<p>" . __("Discount Code", "pmpro") . ": " . $discount_code . "</p>\n";
         } else {
             $this->data["discount_code"] = "";
         }
     } else {
         $this->template = "checkout_freetrial_admin";
         $this->data["discount_code"] = "";
     }
     $enddate = $wpdb->get_var("SELECT UNIX_TIMESTAMP(enddate) FROM {$wpdb->pmpro_memberships_users} WHERE user_id = '" . $user->ID . "' AND status = 'active' LIMIT 1");
     if ($enddate) {
         $this->data["membership_expiration"] = "<p>" . sprintf(__("This membership will expire on %s.", "pmpro"), date_i18n(get_option('date_format'), $enddate)) . "</p>\n";
     } else {
         $this->data["membership_expiration"] = "";
     }
     return $this->sendEmail();
 }
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:68,代码来源:class.pmproemail.php

示例10: getLevels

function getLevels()
{
    global $current_user;
    if ($current_user->ID) {
        $current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID);
    }
    //is there a default level to redirect to?
    if (defined("PMPRO_DEFAULT_LEVEL")) {
        $default_level = intval(PMPRO_DEFAULT_LEVEL);
    } else {
        $default_level = false;
    }
    if ($default_level) {
        wp_redirect(pmpro_url("checkout", "?level=" . $default_level));
        exit;
    }
    global $wpdb, $pmpro_msg, $pmpro_msgt;
    if (isset($_REQUEST['msg'])) {
        if ($_REQUEST['msg'] == 1) {
            $pmpro_msg = __('Your membership status has been updated - Thank you!', 'pmpro');
        } else {
            $pmpro_msg = __('Sorry, your request could not be completed - please try again in a few moments.', 'pmpro');
            $pmpro_msgt = "pmpro_error";
        }
    } else {
        $pmpro_msg = false;
    }
    global $pmpro_levels;
    $pmpro_levels = pmpro_getAllLevels(false, true);
    $pmpro_levels = apply_filters("pmpro_levels_array", $pmpro_levels);
    if ($pmpro_msg) {
        ?>
        <div class="pmpro_message <?php 
        echo $pmpro_msgt;
        ?>
"><?php 
        echo $pmpro_msg;
        ?>
</div>
        <?php 
    }
    ?>

    <div id="main" class="site-main clr">
        <div id="membership-wrapper"> 
            <?php 
    $count = 0;
    $count_levels = count($pmpro_levels);
    $tmp = 0;
    foreach ($pmpro_levels as $level) {
        if (isset($current_user->membership_level->ID)) {
            $current_level = $current_user->membership_level->ID == $level->id;
        } else {
            $current_level = false;
        }
        ?>

                <?php 
        $last = $count_levels - $tmp;
        ?>
  
                <?php 
        $tmp = $tmp + 1;
        ?>

                <div class="box-level <?php 
        if ($count++ % 2 == 0) {
            ?>
odd<?php 
        } else {
            ?>
 even<?php 
        }
        if ($current_level == $level) {
            ?>
 active<?php 
        }
        if ($last == 2 || $last == 1) {
            ?>
 last-box<?php 
        }
        ?>
">
                    <h1><?php 
        echo $current_level ? "<strong>{$level->name}</strong>" : $level->name;
        ?>
</h1>
                    <div class="copy">
                        <?php 
        if (pmpro_isLevelFree($level)) {
            $cost_text = "<strong>Free</strong>";
        } else {
            $cost_text = pmpro_getLevelCost($level, true, true);
        }
        $expiration_text = pmpro_getLevelExpiration($level);
        if (!empty($cost_text) && !empty($expiration_text)) {
            echo $cost_text . "<br />" . $expiration_text;
        } elseif (!empty($cost_text)) {
            echo $cost_text;
        } elseif (!empty($expiration_text)) {
//.........这里部分代码省略.........
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:101,代码来源:shortcode.php

示例11: pmpro_no_quotes

		
		jQuery('#<?php echo $msgfield?>').show();
		jQuery('#<?php echo $msgfield?>').removeClass('pmpro_error');
		jQuery('#<?php echo $msgfield?>').addClass('pmpro_success');
		jQuery('#<?php echo $msgfield?>').addClass('pmpro_discount_code_msg');
		
		jQuery('#other_discount_code_tr').hide();
		jQuery('#other_discount_code_p').html('<a id="other_discount_code_a" href="javascript:void(0);">Click here to change your discount code</a>.');
		jQuery('#other_discount_code_p').show();
		
		jQuery('#other_discount_code_a').click(function() {
			jQuery('#other_discount_code_tr').show();
			jQuery('#other_discount_code_p').hide();			
		});
		
		jQuery('#pmpro_level_cost').html('The <strong><?php echo $discount_code?></strong> code has been applied to your order. <?php echo pmpro_no_quotes(pmpro_getLevelCost($code_level), array('"', "'", "\n", "\r"))?>');
		
		<?php
			//tell gateway javascripts whether or not to fire (e.g. no Stripe on free levels)
			if(pmpro_isLevelFree($code_level))
			{
			?>
				pmpro_require_billing = false;
			<?php
			}			
			else
			{
			?>
				pmpro_require_billing = true;
			<?php
			}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:applydiscountcode.php

示例12: apply_filters

	</thead>
	<tbody>                
		<tr>
			<td>				
				<p>You have selected the <strong><?php echo $pmpro_level->name?></strong> membership level.</p>
				
				<?php
					if(!empty($pmpro_level->description))
						echo apply_filters("the_content", stripslashes($pmpro_level->description));
				?>
				
				<p id="pmpro_level_cost">
					<?php if($discount_code && pmpro_checkDiscountCode($discount_code)) { ?>
						The <strong><?php echo $discount_code?></strong> code has been applied to your order.
					<?php } ?>
					<?php echo pmpro_getLevelCost($pmpro_level)?>
					<?php echo pmpro_getLevelExpiration($pmpro_level)?>
				</p>
				
				<?php do_action("pmpro_checkout_after_level_cost"); ?>				
				
				<?php if($pmpro_show_discount_code) { ?>
				
					<?php if($discount_code && !$pmpro_review) { ?>
						<p id="other_discount_code_p" class="pmpro_small"><a id="other_discount_code_a" href="#discount_code">Click here to change your discount code</a>.</p>
					<?php } elseif(!$pmpro_review) { ?>
						<p id="other_discount_code_p" class="pmpro_small">Do you have a discount code? <a id="other_discount_code_a" href="#discount_code">Click here to enter your discount code</a>.</p>
					<?php } elseif($pmpro_review && $discount_code) { ?>
						<p><strong>Discount Code:</strong> <?php echo $discount_code?></p>
					<?php } ?>
				
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:checkout.php

示例13: pmpropbc_reminder_emails

function pmpropbc_reminder_emails()
{
    global $wpdb;
    //make sure we only run once a day
    $now = current_time('timestamp');
    $today = date("Y-m-d", $now);
    //have to run for each level, so get levels
    $levels = pmpro_getAllLevels(true, true);
    if (empty($levels)) {
        return;
    }
    foreach ($levels as $level) {
        //get options
        $options = pmpropbc_getOptions($level->id);
        if (!empty($options['reminder_days'])) {
            $date = date("Y-m-d", strtotime("+ " . $options['reminder_days'] . " days", $now));
        } else {
            $date = $today;
        }
        //need to get all combos of pay cycle and period
        $sqlQuery = "SELECT DISTINCT(CONCAT(cycle_number, ' ', cycle_period)) FROM {$wpdb->pmpro_memberships_users} WHERE membership_id = '" . $level->id . "' AND cycle_number > 0 AND status = 'active'";
        $combos = $wpdb->get_col($sqlQuery);
        if (empty($combos)) {
            continue;
        }
        foreach ($combos as $combo) {
            //get all check orders still pending after X days
            $sqlQuery = "\r\n\t\t\t\tSELECT id \r\n\t\t\t\tFROM {$wpdb->pmpro_membership_orders} \r\n\t\t\t\tWHERE membership_id = {$level->id} \r\n\t\t\t\t\tAND gateway = 'check' \r\n\t\t\t\t\tAND status = 'pending' \r\n\t\t\t\t\tAND DATE_ADD(timestamp, INTERVAL {$combo}) <= '" . $date . "'\r\n\t\t\t\t\tAND notes NOT LIKE '%Reminder Sent:%' AND notes NOT LIKE '%Reminder Skipped:%'\r\n\t\t\t\tORDER BY id\r\n\t\t\t";
            if (defined('PMPRO_CRON_LIMIT')) {
                $sqlQuery .= " LIMIT " . PMPRO_CRON_LIMIT;
            }
            $orders = $wpdb->get_col($sqlQuery);
            if (empty($orders)) {
                continue;
            }
            foreach ($orders as $order_id) {
                //get some data
                $order = new MemberOrder($order_id);
                $user = get_userdata($order->user_id);
                $user->membership_level = pmpro_getMembershipLevelForUser($order->user_id);
                //if they are no longer a member, let's not send them an email
                if (empty($user->membership_level) || empty($user->membership_level->ID) || $user->membership_level->id != $order->membership_id) {
                    //note when we send the reminder
                    $new_notes = $order->notes . "Reminder Skipped:" . $today . "\n";
                    $wpdb->query("UPDATE {$wpdb->pmpro_membership_orders} SET notes = '" . esc_sql($new_notes) . "' WHERE id = '" . $order_id . "' LIMIT 1");
                    continue;
                }
                //note when we send the reminder
                $new_notes = $order->notes . "Reminder Sent:" . $today . "\n";
                $wpdb->query("UPDATE {$wpdb->pmpro_membership_orders} SET notes = '" . esc_sql($new_notes) . "' WHERE id = '" . $order_id . "' LIMIT 1");
                //setup email to send
                $email = new PMProEmail();
                $email->template = "check_pending_reminder";
                $email->email = $user->user_email;
                $email->subject = sprintf(__("Reminder: New Invoice for %s at %s", "pmpropbc"), $user->membership_level->name, get_option("blogname"));
                //get body from template
                $email->body = file_get_contents(PMPRO_PAY_BY_CHECK_DIR . "/email/" . $email->template . ".html");
                //setup more data
                $email->data = array("name" => $user->display_name, "user_login" => $user->user_login, "sitename" => get_option("blogname"), "siteemail" => pmpro_getOption("from_email"), "membership_id" => $user->membership_level->id, "membership_level_name" => $user->membership_level->name, "membership_cost" => pmpro_getLevelCost($user->membership_level), "login_link" => wp_login_url(pmpro_url("account")), "display_name" => $user->display_name, "user_email" => $user->user_email);
                $email->data["instructions"] = pmpro_getOption('instructions');
                $email->data["invoice_id"] = $order->code;
                $email->data["invoice_total"] = pmpro_formatPrice($order->total);
                $email->data["invoice_date"] = date(get_option('date_format'), $order->timestamp);
                $email->data["billing_name"] = $order->billing->name;
                $email->data["billing_street"] = $order->billing->street;
                $email->data["billing_city"] = $order->billing->city;
                $email->data["billing_state"] = $order->billing->state;
                $email->data["billing_zip"] = $order->billing->zip;
                $email->data["billing_country"] = $order->billing->country;
                $email->data["billing_phone"] = $order->billing->phone;
                $email->data["cardtype"] = $order->cardtype;
                $email->data["accountnumber"] = hideCardNumber($order->accountnumber);
                $email->data["expirationmonth"] = $order->expirationmonth;
                $email->data["expirationyear"] = $order->expirationyear;
                $email->data["billing_address"] = pmpro_formatAddress($order->billing->name, $order->billing->street, "", $order->billing->city, $order->billing->state, $order->billing->zip, $order->billing->country, $order->billing->phone);
                if ($order->getDiscountCode()) {
                    $email->data["discount_code"] = "<p>" . __("Discount Code", "pmpro") . ": " . $order->discount_code->code . "</p>\n";
                } else {
                    $email->data["discount_code"] = "";
                }
                //send the email
                $email->sendEmail();
            }
        }
    }
}
开发者ID:eighty20results,项目名称:pmpro-pay-by-check,代码行数:86,代码来源:pmpro-pay-by-check.php

示例14: pmprodon_pmpro_level_cost_text

function pmprodon_pmpro_level_cost_text($text, $level)
{
    global $pmpro_pages, $pmprodon_original_initial_payment, $pmprodon_text_level_cost_updated;
    if (is_page($pmpro_pages['checkout']) && !empty($pmprodon_original_initial_payment) && empty($pmprodon_text_level_cost_updated)) {
        $olevel = $level;
        $olevel->initial_payment = $pmprodon_original_initial_payment;
        $pmprodon_text_level_cost_updated = true;
        //to prevent loops
        $text = pmpro_getLevelCost($olevel);
    }
    return $text;
}
开发者ID:greathmaster,项目名称:pmpro-donations,代码行数:12,代码来源:pmpro-donations.php


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