本文整理汇总了PHP中edd_get_current_page_url函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_get_current_page_url函数的具体用法?PHP edd_get_current_page_url怎么用?PHP edd_get_current_page_url使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了edd_get_current_page_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edd_get_ajax_url
/**
* Get AJAX URL
*
* @since 1.3
* @return string
*/
function edd_get_ajax_url()
{
$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
$current_url = edd_get_current_page_url();
$ajax_url = admin_url('admin-ajax.php', $scheme);
if (preg_match('/^https/', $current_url) && !preg_match('/^https/', $ajax_url)) {
$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
}
return apply_filters('edd_ajax_url', $ajax_url);
}
示例2: edd_register_form
/**
* Registration Form
*
* @since 2.0
* @global $post
* @param string $redirect Redirect page URL
* @return string Register form
*/
function edd_register_form($redirect = '')
{
global $edd_register_redirect;
if (empty($redirect)) {
$redirect = edd_get_current_page_url();
}
$edd_register_redirect = $redirect;
ob_start();
if (!is_user_logged_in()) {
edd_get_template_part('shortcode', 'register');
}
return apply_filters('edd_register_form', ob_get_clean());
}
示例3: edd_profile_editor_shortcode
/**
* Profile Editor Shortcode
*
* Outputs the EDD Profile Editor to allow users to amend their details from the front-end
*
* @access public
* @since 1.4
* @author Sunny Ratilal
*/
function edd_profile_editor_shortcode($atts, $content = null)
{
global $current_user;
ob_start();
if (is_user_logged_in()) {
$user_id = get_current_user_id();
$first_name = get_user_meta($user_id, 'first_name', true);
$last_name = get_user_meta($user_id, 'last_name', true);
$display_name = $current_user->display_name;
if (isset($_GET['updated']) && $_GET['updated'] == true && !edd_get_errors()) {
?>
<p class="edd_success"><strong><?php
_e('Success', 'edd');
?>
:</strong> <?php
_e('Your profile has been edited successfully.', 'edd');
?>
</p>
<?php
}
edd_print_errors();
?>
<form id="edd_profile_editor_form" class="edd_form" action="<?php
echo edd_get_current_page_url();
?>
" method="post">
<fieldset>
<legend><?php
_e('Change your Name', 'edd');
?>
</legend>
<p id="edd_profile_name_wrap">
<label for="edd_first_name"><?php
_e('First Name', 'edd');
?>
</label>
<input name="edd_first_name" id="edd_first_name" class="text edd-input" type="text" value="<?php
echo $first_name;
?>
" />
<br />
<label for="edd_last_name"><?php
_e('Last Name', 'edd');
?>
</label>
<input name="edd_last_name" id="edd_last_name" class="text edd-input" type="text" value="<?php
echo $last_name;
?>
" />
</p>
<p id="edd_profile_display_name_wrap">
<label for="edd_display_name"><?php
_e('Display Name', 'edd');
?>
</label>
<select name="edd_display_name">
<?php
if (!empty($current_user->first_name)) {
?>
<option <?php
selected($display_name, $current_user->first_name);
?>
value="<?php
echo $current_user->first_name;
?>
"><?php
echo $current_user->first_name;
?>
</option>
<?php
}
?>
<option <?php
selected($display_name, $current_user->user_nicename);
?>
value="<?php
echo $current_user->user_nicename;
?>
"><?php
echo $current_user->user_nicename;
?>
</option>
<?php
if (!empty($current_user->last_name)) {
?>
<option <?php
selected($display_name, $current_user->last_name);
?>
value="<?php
echo $current_user->last_name;
?>
//.........这里部分代码省略.........
示例4: do_action
<?php do_action( 'edd_profile_editor_address' ); ?>
</p>
<?php do_action( 'edd_profile_editor_after_address' ); ?>
<span id="edd_profile_password_label"><legend><?php _e( 'Change your Password', 'edd' ); ?></legend></span>
<p id="edd_profile_password_wrap">
<label for="edd_user_pass"><?php _e( 'New Password', 'edd' ); ?></label>
<input name="edd_new_user_pass1" id="edd_new_user_pass1" class="password edd-input" type="password"/>
<br />
<label for="edd_user_pass"><?php _e( 'Re-enter Password', 'edd' ); ?></label>
<input name="edd_new_user_pass2" id="edd_new_user_pass2" class="password edd-input" type="password"/>
<?php do_action( 'edd_profile_editor_password' ); ?>
</p>
<p class="edd_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'edd' ); ?></p>
<?php do_action( 'edd_profile_editor_after_password' ); ?>
<p id="edd_profile_submit_wrap">
<input type="hidden" name="edd_profile_editor_nonce" value="<?php echo wp_create_nonce( 'edd-profile-editor-nonce' ); ?>"/>
<input type="hidden" name="edd_action" value="edit_user_profile" />
<input type="hidden" name="edd_redirect" value="<?php echo esc_url( edd_get_current_page_url() ); ?>" />
<input name="edd_profile_editor_submit" id="edd_profile_editor_submit" type="submit" class="edd_submit" value="<?php _e( 'Save Changes', 'edd' ); ?>"/>
</p>
</fieldset>
</form><!-- #edd_profile_editor_form -->
<?php do_action( 'edd_profile_editor_after' ); ?>
<?php
else:
echo __( 'You need to login to edit your profile.', 'edd' );
echo edd_login_form();
endif;
示例5: update_payment_form
/**
* Displays a payment update form
*
* @since x.x
* @return string
*/
public function update_payment_form()
{
global $user_ID;
if (!is_user_logged_in()) {
return;
}
if (!EDD_Recurring_Customer::is_customer_active($user_ID)) {
return;
}
if ('cancelled' === EDD_Recurring_Customer::get_customer_status($user_ID)) {
return;
}
// Gateways can choose to show the form or not by using this filter
$show_cc_form = apply_filters('edd_recurring_customer_can_update_card', false, $user_ID);
if (!$show_cc_form) {
$form_fields = array();
$form_fields['cc_number'] = array('type' => 'text', 'options' => array('name' => 'edd-recurring-card-number', 'label' => __('Credit Card Number', 'edd-recurring'), 'placeholder' => __('Credit Card Number', 'edd-recurring'), 'autocomplete' => false));
$form_fields['cc_name'] = array('type' => 'text', 'options' => array('name' => 'edd-recurring-card-name', 'label' => __('Name on Card', 'edd-recurring'), 'placeholder' => __('Name on Card', 'edd-recurring'), 'autocomplete' => true));
$form_fields['cvc_number'] = array('type' => 'text', 'options' => array('name' => 'edd-recurring-cvc-number', 'class' => 'small-text', 'label' => __('CVC Number', 'edd-recurring'), 'placeholder' => __('###', 'edd-recurring'), 'autocomplete' => false));
$form_fields['exp_head'] = array('type' => 'legend', 'options' => array('text' => __('Card Expiration', 'edd-recurring')));
$form_fields['exp_month'] = array('type' => 'month_dropdown');
$form_fields['exp_year'] = array('type' => 'year_dropdown', 'number_of_years' => 10);
$elements = apply_filters('edd_recurring_update_form_elements', $form_fields, $user_ID);
}
$form_output = '';
if (isset($_GET['updated']) && $_GET['updated'] == true && !edd_get_errors()) {
$form_output = '<p class="edd_success"><strong>' . __('Success', 'edd') . ':</strong> ' . __('Your profile has been edited successfully.', 'edd') . '</p>';
}
$form_output .= '<div id="edd-recurring-update-wrapper">';
$form_output .= '<form action="' . remove_query_arg('updated', edd_get_current_page_url()) . '" id="edd-recurring-form" method="POST">';
$form_input_html = '';
if (!$show_cc_form) {
// Iterate through all the form elements, and add them to the HTML
foreach ($elements as $element) {
switch ($element['type']) {
case 'month_dropdown':
$form_input_html .= EDD()->html->{$element}['type']();
break;
case 'year_dropdown':
$form_input_html .= EDD()->html->{$element}['type']('edd-recurring-exp-year', null, 0, $element['number_of_years']);
break;
case 'legend':
$form_input_html .= '<legend>' . $element['options']['text'] . '</legend>';
break;
default:
$form_input_html .= EDD()->html->{$element}['type']($element['options']);
$form_input_html .= '<br />';
break;
}
}
}
ob_start();
edd_print_errors();
$form_output .= ob_get_clean();
$form_output .= apply_filters('edd_recurring_update_form_html', $form_input_html, $user_ID);
$recurring_gateway = apply_filters('edd_recurring_update_gateway', '', $user_ID);
$form_output .= '<input name="edd-recurring-update-gateway" type="hidden" value="' . $recurring_gateway . '" />';
$form_output .= wp_nonce_field('update-payment', 'edd_recurring_update_nonce', true, false);
$form_output .= '<input type="hidden" name="edd_action" value="recurring_update_payment" />';
$form_output .= '<input type="submit" name="edd-recurring-update-submit" id="edd-recurring-update-submit" value="' . esc_attr(__('Update Payment', 'edd-recurring')) . '" />';
$form_output .= '</form>';
$form_output .= '</div>';
return '<div id="edd_checkout_form_wrap">' . $form_output . '</div>';
}
示例6: edd_slg_get_current_page_url
/**
* Current Page URL
*
* @package Easy Digital Downloads - Social Login
* @since 1.0.0
*/
function edd_slg_get_current_page_url()
{
$curent_page_url = remove_query_arg(array('oauth_token', 'oauth_verifier'), edd_get_current_page_url());
return $curent_page_url;
}
示例7: edd_payment_mode_select
/**
* The payment mode select form
*
* @access public
* @since 1.2.2
* @return void
*/
function edd_payment_mode_select()
{
$gateways = edd_get_enabled_payment_gateways();
$page_URL = edd_get_current_page_url();
do_action('edd_payment_mode_top');
?>
<form id="edd_payment_mode" action="<?php
echo $page_URL;
?>
" method="GET">
<fieldset id="edd_payment_mode_select">
<?php
do_action('edd_payment_mode_before_gateways');
?>
<p id="edd-payment-mode-wrap">
<?php
echo '<select class="edd-select" name="payment-mode" id="edd-gateway">';
echo '<option value="0">' . __('Select payment method', 'edd') . '</option>';
foreach ($gateways as $gateway_id => $gateway) {
echo '<option value="' . $gateway_id . '">' . $gateway['checkout_label'] . '</option>';
}
echo '</select>';
?>
</p>
<?php
do_action('edd_payment_mode_after_gateways');
?>
</fieldset>
<fieldset id="edd_payment_mode_submit" class="edd-no-js">
<p id="edd-next-submit-wrap">
<?php
echo edd_checkout_button_next();
?>
</p>
</fieldset>
</form>
<div id="edd_purchase_form_wrap"></div><!-- the checkout fields are loaded into this-->
<?php
do_action('edd_payment_mode_bottom');
}
示例8: edd_payment_mode_select
/**
* Renders the payment mode form by getting all the enabled payment gateways and
* outputting them as radio buttons for the user to choose the payment gateway. If
* a default payment gateway has been chosen from the EDD Settings, it will be
* automatically selected.
*
* @since 1.2.2
* @return void
*/
function edd_payment_mode_select()
{
$gateways = edd_get_enabled_payment_gateways(true);
$page_URL = edd_get_current_page_url();
do_action('edd_payment_mode_top');
?>
<?php
if (edd_is_ajax_disabled()) {
?>
<form id="edd_payment_mode" action="<?php
echo $page_URL;
?>
" method="GET">
<?php
}
?>
<fieldset id="edd_payment_mode_select">
<?php
do_action('edd_payment_mode_before_gateways_wrap');
?>
<div id="edd-payment-mode-wrap">
<span class="edd-payment-mode-label"><?php
_e('Select Payment Method', 'edd');
?>
</span><br/>
<?php
do_action('edd_payment_mode_before_gateways');
foreach ($gateways as $gateway_id => $gateway) {
$checked = checked($gateway_id, edd_get_default_gateway(), false);
$checked_class = $checked ? ' edd-gateway-option-selected' : '';
echo '<label for="edd-gateway-' . esc_attr($gateway_id) . '" class="edd-gateway-option' . $checked_class . '" id="edd-gateway-option-' . esc_attr($gateway_id) . '">';
echo '<input type="radio" name="payment-mode" class="edd-gateway" id="edd-gateway-' . esc_attr($gateway_id) . '" value="' . esc_attr($gateway_id) . '"' . $checked . '>' . esc_html($gateway['checkout_label']);
echo '</label>';
}
do_action('edd_payment_mode_after_gateways');
?>
</div>
<?php
do_action('edd_payment_mode_after_gateways_wrap');
?>
</fieldset>
<fieldset id="edd_payment_mode_submit" class="edd-no-js">
<p id="edd-next-submit-wrap">
<?php
echo edd_checkout_button_next();
?>
</p>
</fieldset>
<?php
if (edd_is_ajax_disabled()) {
?>
</form>
<?php
}
?>
<div id="edd_purchase_form_wrap"></div><!-- the checkout fields are loaded into this-->
<?php
do_action('edd_payment_mode_bottom');
}
示例9: edd_remove_cart_fee_url
/**
* Returns the URL to remove an item from the cart
*
* @since 1.0
* @global $post
* @param string $fee_id Fee ID
* @return string $remove_url URL to remove the cart item
*/
function edd_remove_cart_fee_url($fee_id = '')
{
global $post;
if (defined('DOING_AJAX')) {
$current_page = edd_get_checkout_uri();
} else {
if (is_page()) {
$current_page = add_query_arg('page_id', $post->ID, home_url('index.php'));
} else {
if (is_singular()) {
$current_page = add_query_arg('p', $post->ID, home_url('index.php'));
} else {
$current_page = edd_get_current_page_url();
}
}
}
$remove_url = add_query_arg(array('fee' => $fee_id, 'edd_action' => 'remove_fee'), $current_page);
return apply_filters('edd_remove_fee_url', $remove_url);
}
示例10: edd_login_form
/**
* Login Form
*
* @access private
* @since 1.0
* @return string
*/
function edd_login_form($redirect = '')
{
global $edd_options, $post;
if ($redirect == '') {
$redirect = edd_get_current_page_url();
}
ob_start();
if (!is_user_logged_in()) {
?>
<?php
// show any error messages after form submission
edd_print_errors();
?>
<form id="edd_login_form" class="edd_form" action="" method="post">
<fieldset>
<legend><?php
_e('Log into Your Account', 'edd');
?>
</legend>
<p>
<label for="edd_user_Login"><?php
_e('Username', 'edd');
?>
</label>
<input name="edd_user_login" id="edd_user_login" class="required" type="text" title="<?php
_e('Username', 'edd');
?>
"/>
</p>
<p>
<label for="edd_user_pass"><?php
_e('Password', 'edd');
?>
</label>
<input name="edd_user_pass" id="edd_user_pass" class="password required" type="password"/>
</p>
<p>
<input type="hidden" name="edd_redirect" value="<?php
echo $redirect;
?>
"/>
<input type="hidden" name="edd_login_nonce" value="<?php
echo wp_create_nonce('edd-login-nonce');
?>
"/>
<input type="hidden" name="edd_action" value="user_login"/>
<input id="edd_login_submit" type="submit" class="edd_submit" value="<?php
_e('Login', 'edd');
?>
"/>
</p>
<p class="edd-lost-password">
<a href="<?php
echo wp_lostpassword_url();
?>
" title="<?php
_e('Lost Password', 'edd');
?>
">
<?php
_e('Lost Password?', 'edd');
?>
</a>
</p>
</fieldset>
</form>
<?php
} else {
echo '<p class="edd-logged-in">' . __('You are already logged in', 'edd') . '</p>';
}
return ob_get_clean();
}
示例11: edd_points_redeem_points
/**
* Calculate Discount towards Points
*
* Handles to calculate the discount towards points
*
* @package Easy Digital Downloads - Points and Rewards
* @since 1.0.0
**/
public function edd_points_redeem_points()
{
global $current_user, $edd_options;
//remove applied points discount
if (isset($_GET['edd_points_remove_discount']) && !empty($_GET['edd_points_remove_discount']) && $_GET['edd_points_remove_discount'] == 'remove') {
//get discount towards points
$gotdiscount = EDD()->fees->get_fee('points_redeem');
//check redeempoints set and cart is empty
if (!empty($gotdiscount)) {
//remove fees towards fees
EDD()->fees->remove_fee('points_redeem');
$redirecturl = remove_query_arg('edd_points_remove_discount', get_permalink());
//redirect to current page
wp_redirect($redirecturl);
exit;
}
}
//end if to check remove discount is called or not
//get points plural label
$pointslabel = isset($edd_options['edd_points_label']['plural']) && !empty($edd_options['edd_points_label']['plural']) ? $edd_options['edd_points_label']['plural'] : 'Points';
//check apply discount button is clicked or not
if (isset($_POST['edd_points_apply_discount']) && !empty($_POST['edd_points_apply_discount']) && $_POST['edd_points_apply_discount'] == __('Apply Discount', 'eddpoints')) {
//calculate discount towards points
$available_discount = $this->model->edd_points_get_discount_for_redeeming_points();
//calcualte the redumption price
EDD()->fees->add_fee($available_discount * -1, sprintf(__('%s Discount', 'eddpoints'), $pointslabel), 'points_redeem');
wp_redirect(edd_get_current_page_url());
exit;
} else {
//else change the fees if its changed from backend
$gotdiscount = EDD()->fees->get_fee('points_redeem');
if (isset($gotdiscount['amount'])) {
//calculate discount towards points
$available_discount = $this->model->edd_points_get_discount_for_redeeming_points();
//calcualte the redumption price
EDD()->fees->add_fee($available_discount * -1, sprintf(__('%s Discount', 'eddpoints'), $pointslabel), 'points_redeem');
}
//end if to check the user get already points discount or not
}
}
示例12: edd_wl_remove_item_url
/**
* Returns the URL to remove an item from the wish list
*
* @since 1.0
* @global $post
* @param int $cart_key Cart item key
* @param object $post Download (post) object
* @param bool $ajax AJAX?
* @return string $remove_url URL to remove the wish list item
*/
function edd_wl_remove_item_url($cart_key, $post, $ajax = false)
{
global $post;
if (is_page()) {
$current_page = add_query_arg('page_id', $post->ID, home_url('index.php'));
} else {
if (is_singular()) {
$current_page = add_query_arg('p', $post->ID, home_url('index.php'));
} else {
$current_page = edd_get_current_page_url();
}
}
$remove_url = add_query_arg(array('cart_item' => $cart_key, 'edd_action' => 'remove'), $current_page);
return esc_url(apply_filters('edd_remove_item_url', $remove_url));
}
示例13: eddc_user_commissions
//.........这里部分代码省略.........
</td>
<?php
do_action('eddc_user_commissions_unpaid_row_end', $commission);
?>
</tr>
<?php
}
?>
<?php
} else {
?>
<tr class="edd_user_commission_row edd_row_empty">
<td colspan="4"><?php
_e('No unpaid commissions', 'eddc');
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<div id="edd_user_commissions_unpaid_total"><?php
_e('Total unpaid:', 'eddc');
?>
<?php
echo edd_currency_filter(edd_format_amount(eddc_get_unpaid_totals($user_ID)));
?>
</div>
<div id="edd_commissions_unpaid_pagination" class="navigation">
<?php
$big = 999999;
echo paginate_links(array('base' => remove_query_arg('eddcup', edd_get_current_page_url()) . '%_%#edd_user_commissions_unpaid', 'format' => '?eddcup=%#%', 'current' => max(1, $unpaid_paged), 'total' => $unpaid_total_pages));
?>
</div>
</div><!--end #edd_user_commissions_unpaid-->
<!-- paid -->
<div id="edd_user_commissions_paid">
<h3 class="edd_user_commissions_header"><?php
_e('Paid Commissions', 'eddc');
?>
</h3>
<table id="edd_user_paid_commissions_table" class="edd_user_commissions">
<thead>
<tr class="edd_user_commission_row">
<?php
do_action('eddc_user_commissions_paid_head_row_begin');
?>
<th class="edd_commission_item"><?php
_e('Item', 'eddc');
?>
</th>
<th class="edd_commission_amount"><?php
_e('Amount', 'eddc');
?>
</th>
<th class="edd_commission_rate"><?php
_e('Rate', 'eddc');
?>
</th>
<th class="edd_commission_date"><?php
_e('Date', 'eddc');
?>
示例14: eddc_user_commissions
/**
* Given a user id, provide a detailed list of commissions
*
* @param integer $user_id Given a user id, get their commissions details
* @return string HTML markup for the commissions details
*/
function eddc_user_commissions($user_id = 0)
{
$user_id = empty($user_id) ? get_current_user_id() : $user_id;
// If still empty, exit
if (empty($user_id)) {
return;
}
$per_page = 20;
$unpaid_paged = isset($_GET['eddcup']) ? absint($_GET['eddcup']) : 1;
$paid_paged = isset($_GET['eddcp']) ? absint($_GET['eddcp']) : 1;
$revoked_paged = isset($_GET['eddcrp']) ? absint($_GET['eddcrp']) : 1;
$unpaid_commissions = eddc_get_unpaid_commissions(array('user_id' => $user_id, 'number' => $per_page, 'paged' => $unpaid_paged));
$paid_commissions = eddc_get_paid_commissions(array('user_id' => $user_id, 'number' => $per_page, 'paged' => $paid_paged));
$revoked_commissions = eddc_get_revoked_commissions(array('user_id' => $user_id, 'number' => $per_page, 'paged' => $paid_paged));
$total_unpaid = eddc_count_user_commissions($user_id, 'unpaid');
$total_paid = eddc_count_user_commissions($user_id, 'paid');
$total_revoked = eddc_count_user_commissions($user_id, 'revoked');
$unpaid_offset = $per_page * ($unpaid_paged - 1);
$unpaid_total_pages = ceil($total_unpaid / $per_page);
$paid_offset = $per_page * ($paid_paged - 1);
$paid_total_pages = ceil($total_paid / $per_page);
$revoked_offset = $per_page * ($revoked_paged - 1);
$revoked_total_pages = ceil($total_revoked / $per_page);
$page_prefix = false !== strpos(edd_get_current_page_url(), '?') ? '&' : '?';
$stats = '';
if (eddc_user_has_commissions($user_id)) {
// only show tables if user has commission data
ob_start();
?>
<div id="edd_user_commissions">
<!-- unpaid -->
<div id="edd_user_commissions_unpaid">
<h3 class="edd_user_commissions_header"><?php
_e('Unpaid Commissions', 'eddc');
?>
</h3>
<table id="edd_user_unpaid_commissions_table" class="edd_user_commissions">
<thead>
<tr class="edd_user_commission_row">
<?php
do_action('eddc_user_commissions_unpaid_head_row_begin');
?>
<th class="edd_commission_item"><?php
_e('Item', 'eddc');
?>
</th>
<th class="edd_commission_amount"><?php
_e('Amount', 'eddc');
?>
</th>
<th class="edd_commission_rate"><?php
_e('Rate', 'eddc');
?>
</th>
<th class="edd_commission_date"><?php
_e('Date', 'eddc');
?>
</th>
<?php
do_action('eddc_user_commissions_unpaid_head_row_end');
?>
</tr>
</thead>
<tbody>
<?php
$total = (double) 0;
?>
<?php
if (!empty($unpaid_commissions)) {
?>
<?php
foreach ($unpaid_commissions as $commission) {
?>
<tr class="edd_user_commission_row">
<?php
do_action('eddc_user_commissions_unpaid_row_begin', $commission);
$item_name = get_the_title(get_post_meta($commission->ID, '_download_id', true));
$commission_info = get_post_meta($commission->ID, '_edd_commission_info', true);
$amount = $commission_info['amount'];
$rate = $commission_info['rate'];
?>
<td class="edd_commission_item"><?php
echo esc_html($item_name);
?>
</td>
<td class="edd_commission_amount">
<?php
echo edd_currency_filter(edd_format_amount(edd_sanitize_amount($amount)));
?>
<?php
if (eddc_commission_is_renewal($commission->ID)) {
?>
↺
//.........这里部分代码省略.........
示例15: edd_points_redeem_point_markup
/**
* Redeem Points Markup
*
* Handles to show redeem points markup
*
* @package Easy Digital Downloads - Points and Rewards
* @since 1.0.0
**/
public function edd_points_redeem_point_markup()
{
global $current_user, $edd_options;
if (!isset($_GET['payment-mode']) && count(edd_get_enabled_payment_gateways()) > 1 && !edd_is_ajax_enabled()) {
return;
}
// Only show once a payment method has been selected if ajax is disabled
//get points plural label
$plurallabel = isset($edd_options['edd_points_label']['plural']) && !empty($edd_options['edd_points_label']['plural']) ? $edd_options['edd_points_label']['plural'] : 'Point';
//get discount got by user via points
$gotdiscount = EDD()->fees->get_fee('points_redeem');
//get message from settings
$redemptionmessage = $edd_options['edd_points_reedem_cart_messages'];
//calculate discount towards points
$available_discount = $this->model->edd_points_get_discount_for_redeeming_points();
$button_color = isset($edd_options['checkout_color']) ? $edd_options['checkout_color'] : '';
if (!empty($available_discount) && !empty($redemptionmessage) && empty($gotdiscount)) {
//get discounte price from points
$discountedpoints = $this->model->edd_points_calculate_points($available_discount);
//get points label to show to user
$points_label = $this->model->edd_points_get_points_label($discountedpoints);
//display price to show to user
$displaydiscprice = edd_currency_filter($available_discount);
//show message on checkout page
$points_replace = array("{points}", "{points_label}", "{points_value}");
$replace_message = array($discountedpoints, $points_label, $displaydiscprice);
$message = $this->model->edd_points_replace_array($points_replace, $replace_message, $redemptionmessage);
?>
<fieldset class="edd-points-redeem-points-wrap">
<form method="POST" action="" >
<input type="submit" id="edd_points_apply_discount" name="edd_points_apply_discount" class="button edd-submit <?php
_e($button_color);
?>
edd-points-apply-discount-button" value="<?php
_e('Apply Discount', 'eddpoints');
?>
" />
</form>
<div class="edd-points-redeem-message"><?php
echo $message;
?>
</div><!--.edd-points-checkout-message-->
</fieldset><!--.edd-points-redeem-points-wrap-->
<?php
}
//end if cart total not empty
//if points discount applied then show remove link
if (!empty($gotdiscount)) {
$removfeesurl = add_query_arg(array('edd_points_remove_discount' => 'remove'), edd_get_current_page_url());
?>
<fieldset class="edd-points-checkout-message">
<a href="<?php
echo $removfeesurl;
?>
" class="button edd-point-remove-discount-link edd-points-float-right"><?php
_e('Remove', 'eddpoints');
?>
</a>
<div class="edd-points-remove-disocunt-message"><?php
printf(__('Remove %s Discount', 'eddpoints'), $plurallabel);
?>
</div><!--.edd-points-checkout-message-->
</fieldset><!--.edd-points-redeem-points-wrap-->
<?php
}
}