Use new code style
This commit is contained in:
@ -8,8 +8,6 @@
|
||||
<?php
|
||||
|
||||
if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset($_GET['step']) && $_GET['step'] == 'plan') :
|
||||
|
||||
|
||||
$coupon = wu_get_coupon($_GET['coupon']);
|
||||
|
||||
?>
|
||||
@ -17,326 +15,326 @@ if (isset($_GET['coupon']) && wu_get_coupon($_GET['coupon']) !== false && isset(
|
||||
<div id="coupon-code-app">
|
||||
</div>
|
||||
<script>
|
||||
(function($) {
|
||||
(function($) {
|
||||
|
||||
var coupon_app = new Vue({
|
||||
el: "#coupon-code-app",
|
||||
data: {
|
||||
coupon_id: '',
|
||||
coupon: '<?php echo json_encode($coupon); ?>',
|
||||
type : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_type', true)); ?>',
|
||||
value : parseFloat(<?php echo json_encode(get_post_meta($coupon->id, 'wpu_value', true)); ?>),
|
||||
applies_to_setup_fee : <?php echo json_encode(get_post_meta($coupon->id, 'wpu_applies_to_setup_fee', true)); ?>,
|
||||
setup_fee_discount_value : parseFloat(<?php echo json_encode(get_post_meta($coupon->id, 'wpu_setup_fee_discount_value', true)); ?>),
|
||||
setup_fee_discount_type : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_setup_fee_discount_type', true)); ?>',
|
||||
allowed_plans : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_allowed_plans', true)); ?>',
|
||||
allowed_freqs : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_allowed_freqs', true)); ?>',
|
||||
success: false,
|
||||
},
|
||||
mounted: function() {
|
||||
var coupon_app = new Vue({
|
||||
el: "#coupon-code-app",
|
||||
data: {
|
||||
coupon_id: '',
|
||||
coupon: '<?php echo json_encode($coupon); ?>',
|
||||
type : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_type', true)); ?>',
|
||||
value : parseFloat(<?php echo json_encode(get_post_meta($coupon->id, 'wpu_value', true)); ?>),
|
||||
applies_to_setup_fee : <?php echo json_encode(get_post_meta($coupon->id, 'wpu_applies_to_setup_fee', true)); ?>,
|
||||
setup_fee_discount_value : parseFloat(<?php echo json_encode(get_post_meta($coupon->id, 'wpu_setup_fee_discount_value', true)); ?>),
|
||||
setup_fee_discount_type : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_setup_fee_discount_type', true)); ?>',
|
||||
allowed_plans : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_allowed_plans', true)); ?>',
|
||||
allowed_freqs : '<?php echo json_encode(get_post_meta($coupon->id, 'wpu_allowed_freqs', true)); ?>',
|
||||
success: false,
|
||||
},
|
||||
mounted: function() {
|
||||
|
||||
this.apply_coupon();
|
||||
this.add_event_tabs();
|
||||
this.apply_coupon();
|
||||
this.add_event_tabs();
|
||||
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
methods: {
|
||||
|
||||
add_event_tabs: function() {
|
||||
add_event_tabs: function() {
|
||||
|
||||
$('.wu-plans-frequency-selector li a').each(function() {
|
||||
$('.wu-plans-frequency-selector li a').each(function() {
|
||||
|
||||
this.addEventListener('click',function() {
|
||||
coupon_app.apply_coupon();
|
||||
});
|
||||
this.addEventListener('click',function() {
|
||||
coupon_app.apply_coupon();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
apply_coupon: function() {
|
||||
apply_coupon: function() {
|
||||
|
||||
if(this.coupon) {
|
||||
if(this.coupon) {
|
||||
|
||||
$("body").block({
|
||||
message: null,
|
||||
overlayCSS: {
|
||||
background: "#F1F1F1",
|
||||
opacity: 0.6
|
||||
}
|
||||
});
|
||||
$("body").block({
|
||||
message: null,
|
||||
overlayCSS: {
|
||||
background: "#F1F1F1",
|
||||
opacity: 0.6
|
||||
}
|
||||
});
|
||||
|
||||
this.coupon_id = this.coupon.id;
|
||||
this.coupon_id = this.coupon.id;
|
||||
|
||||
var coupon_type = this.type;
|
||||
var coupon_type = this.type;
|
||||
|
||||
var coupon_value = this.value;
|
||||
var coupon_value = this.value;
|
||||
|
||||
var applies_to_setup_fee = this.applies_to_setup_fee;
|
||||
var setup_fee_discount_value = this.setup_fee_discount_value;
|
||||
var setup_fee_discount_type = this.setup_fee_discount_type;
|
||||
var allowed_plans = $.parseJSON(this.allowed_plans);
|
||||
var allowed_freqs = $.parseJSON(this.allowed_freqs);
|
||||
var applies_to_setup_fee = this.applies_to_setup_fee;
|
||||
var setup_fee_discount_value = this.setup_fee_discount_value;
|
||||
var setup_fee_discount_type = this.setup_fee_discount_type;
|
||||
var allowed_plans = $.parseJSON(this.allowed_plans);
|
||||
var allowed_freqs = $.parseJSON(this.allowed_freqs);
|
||||
|
||||
//$('#signupform').append($('#coupon_id'));
|
||||
//$('#signupform').append($('#coupon_id'));
|
||||
|
||||
$('.superscript').show();
|
||||
$('h5 sub').show();
|
||||
$('.superscript').show();
|
||||
$('h5 sub').show();
|
||||
|
||||
setTimeout( function() { $('.wu-plan').each(function() {
|
||||
setTimeout( function() { $('.wu-plan').each(function() {
|
||||
|
||||
if (!$(this).find('.old-price').get(0)) {
|
||||
if (!$(this).find('.old-price').get(0)) {
|
||||
|
||||
$(this).find('h4').after('<div class="old-price">--</div>');
|
||||
$(this).find('h4').after('<div class="old-price">--</div>');
|
||||
|
||||
} // end if;
|
||||
} // end if;
|
||||
|
||||
let plan_id = $(this).data('plan');
|
||||
let plan_id = $(this).data('plan');
|
||||
|
||||
let is_allowed_plan = false;
|
||||
let is_allowed_plan = false;
|
||||
|
||||
let is_allowed_freq = false;
|
||||
let is_allowed_freq = false;
|
||||
|
||||
// check plan is_allowed
|
||||
if (typeof allowed_plans === 'object'){
|
||||
// check plan is_allowed
|
||||
if (typeof allowed_plans === 'object'){
|
||||
|
||||
for (var each_plan of allowed_plans) {
|
||||
for (var each_plan of allowed_plans) {
|
||||
|
||||
if (parseInt(each_plan) == plan_id) {
|
||||
is_allowed_plan = true;
|
||||
}
|
||||
if (parseInt(each_plan) == plan_id) {
|
||||
is_allowed_plan = true;
|
||||
}
|
||||
|
||||
} // end for;
|
||||
} // end for;
|
||||
|
||||
} else {
|
||||
is_allowed_plan = true;
|
||||
}
|
||||
} else {
|
||||
is_allowed_plan = true;
|
||||
}
|
||||
|
||||
// check freq is_allowed
|
||||
// check freq is_allowed
|
||||
|
||||
if (typeof allowed_freqs === 'object'){
|
||||
if (typeof allowed_freqs === 'object'){
|
||||
|
||||
for (var each_freq of allowed_freqs) {
|
||||
for (var each_freq of allowed_freqs) {
|
||||
|
||||
if (each_freq == $('#wu_plan_freq').val()) {
|
||||
is_allowed_freq = true;
|
||||
}
|
||||
if (each_freq == $('#wu_plan_freq').val()) {
|
||||
is_allowed_freq = true;
|
||||
}
|
||||
|
||||
} // end for;
|
||||
} // end for;
|
||||
|
||||
} else {
|
||||
is_allowed_freq = true;
|
||||
}
|
||||
} else {
|
||||
is_allowed_freq = true;
|
||||
}
|
||||
|
||||
if (!is_allowed_plan) {
|
||||
if (!is_allowed_plan) {
|
||||
|
||||
$("body").unblock();
|
||||
return;
|
||||
$("body").unblock();
|
||||
return;
|
||||
|
||||
} // end if;
|
||||
} // end if;
|
||||
|
||||
if (!is_allowed_freq) {
|
||||
if (!is_allowed_freq) {
|
||||
|
||||
$("body").unblock();
|
||||
$(".old-price").hide();
|
||||
$(".off-value").hide();
|
||||
return;
|
||||
$("body").unblock();
|
||||
$(".old-price").hide();
|
||||
$(".off-value").hide();
|
||||
return;
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
$(".old-price").show();
|
||||
$(".off-value").show();
|
||||
$(".old-price").show();
|
||||
$(".off-value").show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let old_price = $(this).data('price-' + $('#wu_plan_freq').val());
|
||||
let old_price = $(this).data('price-' + $('#wu_plan_freq').val());
|
||||
|
||||
old_price = wu_fix_money_string(old_price);
|
||||
old_price = wu_fix_money_string(old_price);
|
||||
|
||||
let new_price = 0;
|
||||
let new_price = 0;
|
||||
|
||||
let old_yearly_value = old_price * jQuery('#wu_plan_freq').val();
|
||||
let old_yearly_value = old_price * jQuery('#wu_plan_freq').val();
|
||||
|
||||
let new_yearly_value = 0;
|
||||
let new_yearly_value = 0;
|
||||
|
||||
let old_setupfee = $(this).find('.pricing-table-setupfee') ? $(this).find('.pricing-table-setupfee').attr('data-value') : 0;
|
||||
let old_setupfee = $(this).find('.pricing-table-setupfee') ? $(this).find('.pricing-table-setupfee').attr('data-value') : 0;
|
||||
|
||||
let new_setupfee = 0;
|
||||
let new_setupfee = 0;
|
||||
|
||||
let off_with_symbol = '';
|
||||
let off_with_symbol = '';
|
||||
|
||||
// OFF RENDER
|
||||
if (coupon_type != '"absolute"')
|
||||
off_with_symbol = ''.concat(coupon_value, '%');
|
||||
else
|
||||
off_with_symbol = accounting.formatMoney(parseFloat(coupon_value));
|
||||
// OFF RENDER
|
||||
if (coupon_type != '"absolute"')
|
||||
off_with_symbol = ''.concat(coupon_value, '%');
|
||||
else
|
||||
off_with_symbol = accounting.formatMoney(parseFloat(coupon_value));
|
||||
|
||||
$(this).find('.old-price').html(accounting.formatMoney(parseFloat(old_price)));
|
||||
if (!$(this).find('.off-value').get(0)) {
|
||||
$(this).find('.old-price').html(accounting.formatMoney(parseFloat(old_price)));
|
||||
if (!$(this).find('.off-value').get(0)) {
|
||||
|
||||
$(this).find('.old-price').after('<div class="off-value">(' + off_with_symbol + ' ' + '<?php _e('OFF', 'wp-ultimo'); ?>' + ')</div>');
|
||||
$(this).find('.old-price').after('<div class="off-value">(' + off_with_symbol + ' ' + '<?php _e('OFF', 'wp-ultimo'); ?>' + ')</div>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(applies_to_setup_fee) {
|
||||
if(applies_to_setup_fee) {
|
||||
|
||||
if (setup_fee_discount_type != '"absolute"')
|
||||
setupfee_off_with_symbol = ''.concat(setup_fee_discount_value, '%');
|
||||
else
|
||||
setupfee_off_with_symbol = accounting.formatMoney(parseFloat(setup_fee_discount_value));
|
||||
if (setup_fee_discount_type != '"absolute"')
|
||||
setupfee_off_with_symbol = ''.concat(setup_fee_discount_value, '%');
|
||||
else
|
||||
setupfee_off_with_symbol = accounting.formatMoney(parseFloat(setup_fee_discount_value));
|
||||
|
||||
if (!$(this).find('.setupfee-off-value').get(0)) {
|
||||
if (!$(this).find('.setupfee-off-value').get(0)) {
|
||||
|
||||
$(this).find('.pricing-table-setupfee').after('<span class="setupfee-off-value"> (' + setupfee_off_with_symbol + ' ' + '<?php _e('OFF', 'wp-ultimo'); ?>' + ')</span>');
|
||||
$(this).find('.pricing-table-setupfee').after('<span class="setupfee-off-value"> (' + setupfee_off_with_symbol + ' ' + '<?php _e('OFF', 'wp-ultimo'); ?>' + ')</span>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// END OFF RENDER
|
||||
// END OFF RENDER
|
||||
|
||||
if(coupon_type != '"absolute"') {
|
||||
if(coupon_type != '"absolute"') {
|
||||
|
||||
new_price = old_price * ((100 - coupon_value) / 100);
|
||||
new_price = old_price * ((100 - coupon_value) / 100);
|
||||
|
||||
new_yearly_value = old_yearly_value * ((100 - coupon_value) / 100);
|
||||
new_yearly_value = old_yearly_value * ((100 - coupon_value) / 100);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
if(jQuery('#wu_plan_freq').val() > 1){
|
||||
if(jQuery('#wu_plan_freq').val() > 1){
|
||||
|
||||
new_price = ((old_price * jQuery('#wu_plan_freq').val()) - parseFloat(coupon_value)) / jQuery('#wu_plan_freq').val();
|
||||
new_price = ((old_price * jQuery('#wu_plan_freq').val()) - parseFloat(coupon_value)) / jQuery('#wu_plan_freq').val();
|
||||
|
||||
new_yearly_value = old_yearly_value - parseFloat(coupon_value);
|
||||
new_yearly_value = old_yearly_value - parseFloat(coupon_value);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
new_price = old_price - parseFloat(coupon_value);
|
||||
new_price = old_price - parseFloat(coupon_value);
|
||||
|
||||
new_yearly_value = old_yearly_value - parseFloat(coupon_value);
|
||||
new_yearly_value = old_yearly_value - parseFloat(coupon_value);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} // end if;
|
||||
} // end if;
|
||||
|
||||
if (applies_to_setup_fee) {
|
||||
if (applies_to_setup_fee) {
|
||||
|
||||
if (setup_fee_discount_type != '"absolute"') {
|
||||
if (setup_fee_discount_type != '"absolute"') {
|
||||
|
||||
new_setupfee = old_setupfee * ((100 - setup_fee_discount_value) / 100);
|
||||
new_setupfee = old_setupfee * ((100 - setup_fee_discount_value) / 100);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
new_setupfee = old_setupfee - parseFloat(setup_fee_discount_value);
|
||||
new_setupfee = old_setupfee - parseFloat(setup_fee_discount_value);
|
||||
|
||||
} // end if;
|
||||
} // end if;
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
new_setupfee = old_setupfee;
|
||||
new_setupfee = old_setupfee;
|
||||
|
||||
} // end if;
|
||||
} // end if;
|
||||
|
||||
if (new_yearly_value > 0) {
|
||||
if (new_yearly_value > 0) {
|
||||
|
||||
wu_set_yearly_value(this, new_yearly_value);
|
||||
wu_set_yearly_value(this, new_yearly_value);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
$(this).find('.total-price.total-price-' + $('#wu_plan_freq').val() ).html(' <?php esc_js(_e('Free!', 'wp-ultimo')); ?>');
|
||||
$(this).find('.total-price.total-price-' + $('#wu_plan_freq').val() ).html(' <?php esc_js(_e('Free!', 'wp-ultimo')); ?>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (new_setupfee > 0) {
|
||||
if (new_setupfee > 0) {
|
||||
|
||||
wu_set_setupfee_value(this, new_setupfee);
|
||||
wu_set_setupfee_value(this, new_setupfee);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
$(this).find('.pricing-table-setupfee').html(' <?php esc_js(_e('No Setup Fee', 'wp-ultimo')); ?>');
|
||||
$(this).find('.pricing-table-setupfee').html(' <?php esc_js(_e('No Setup Fee', 'wp-ultimo')); ?>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (new_price > 0) {
|
||||
if (new_price > 0) {
|
||||
|
||||
$(this).find('.plan-price').html( accounting.formatMoney( parseFloat(new_price) ) );
|
||||
$(this).find('.plan-price').html( accounting.formatMoney( parseFloat(new_price) ) );
|
||||
|
||||
if ( $(this).find('.plan-price').html().indexOf(wpu.currency_symbol) !== -1 ) {
|
||||
if ( $(this).find('.plan-price').html().indexOf(wpu.currency_symbol) !== -1 ) {
|
||||
|
||||
$(this).find('.plan-price').html($(this).find('.plan-price').html().replace(wpu.currency_symbol, ''));
|
||||
$(this).find('.plan-price').html($(this).find('.plan-price').html().replace(wpu.currency_symbol, ''));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
let plan_price = $(this).find('.plan-price');
|
||||
plan_price.html(' <?php esc_js(_e('Free!', 'wp-ultimo')); ?>');
|
||||
let hagacinco = $(this).find('h5');
|
||||
hagacinco.find('sub').hide();
|
||||
hagacinco.find('.superscript').hide();
|
||||
let plan_price = $(this).find('.plan-price');
|
||||
plan_price.html(' <?php esc_js(_e('Free!', 'wp-ultimo')); ?>');
|
||||
let hagacinco = $(this).find('h5');
|
||||
hagacinco.find('sub').hide();
|
||||
hagacinco.find('.superscript').hide();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$("body").unblock();
|
||||
$("body").unblock();
|
||||
|
||||
}); }, 400);
|
||||
}); }, 400);
|
||||
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
$('.old-price').hide();
|
||||
$('.old-price').hide();
|
||||
|
||||
this.coupon_id = '';
|
||||
this.coupon_id = '';
|
||||
|
||||
$('.wu-plan').each(function() {
|
||||
$('.wu-plan').each(function() {
|
||||
|
||||
var price = $(this).data('price-' + $('#wu_plan_freq').val());
|
||||
var price = $(this).data('price-' + $('#wu_plan_freq').val());
|
||||
|
||||
$(this).find('.plan-price').html( price );
|
||||
$(this).find('.plan-price').html( price );
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
||||
function wu_fix_money_string(value) {
|
||||
function wu_fix_money_string(value) {
|
||||
|
||||
if(typeof value == 'number'){
|
||||
value = value.toString();
|
||||
}
|
||||
if(typeof value == 'number'){
|
||||
value = value.toString();
|
||||
}
|
||||
|
||||
return parseFloat(value.replace(wpu.thousand_separator, '').replace(wpu.decimal_separator, '.'));
|
||||
return parseFloat(value.replace(wpu.thousand_separator, '').replace(wpu.decimal_separator, '.'));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function wu_set_setupfee_value(list, value) {
|
||||
function wu_set_setupfee_value(list, value) {
|
||||
|
||||
jQuery(list).find('.pricing-table-setupfee').html( accounting.formatMoney(value));
|
||||
jQuery(list).find('.pricing-table-setupfee').html( accounting.formatMoney(value));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function wu_set_yearly_value(list, value) {
|
||||
function wu_set_yearly_value(list, value) {
|
||||
|
||||
var current_freq = jQuery('#wu_plan_freq').val();
|
||||
var current_freq = jQuery('#wu_plan_freq').val();
|
||||
|
||||
var string = jQuery(list).find('.total-price.total-price-' + current_freq).html();
|
||||
var string = jQuery(list).find('.total-price.total-price-' + current_freq).html();
|
||||
|
||||
if (string) {
|
||||
if (string) {
|
||||
|
||||
var parts = string.split(',');
|
||||
var parts = string.split(',');
|
||||
|
||||
var result = accounting.formatMoney(parseFloat(value)) + ', ' + parts[1];
|
||||
var result = accounting.formatMoney(parseFloat(value)) + ', ' + parts[1];
|
||||
|
||||
jQuery(list).find('.total-price.total-price-' + current_freq).html(result);
|
||||
jQuery(list).find('.total-price.total-price-' + current_freq).html(result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
@ -15,8 +15,8 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
@ -25,29 +25,33 @@ if (!defined('ABSPATH')) {
|
||||
|
||||
<ul class="wu-plans-frequency-selector">
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$prices = array(
|
||||
1 => __('Monthly', 'wp-ultimo'),
|
||||
3 => __('Quarterly', 'wp-ultimo'),
|
||||
12 => __('Yearly', 'wp-ultimo'),
|
||||
);
|
||||
$prices = array(
|
||||
1 => __('Monthly', 'wp-ultimo'),
|
||||
3 => __('Quarterly', 'wp-ultimo'),
|
||||
12 => __('Yearly', 'wp-ultimo'),
|
||||
);
|
||||
|
||||
$first = true;
|
||||
$first = true;
|
||||
|
||||
foreach ($prices as $type => $name) :
|
||||
foreach ($prices as $type => $name) :
|
||||
if ( ! wu_get_setting('enable_price_' . $type, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!wu_get_setting('enable_price_'.$type, true)) continue;
|
||||
?>
|
||||
|
||||
?>
|
||||
<li>
|
||||
<a class="<?php echo $first ? 'active first' : ''; ?>" data-frequency-selector="<?php echo $type; ?>" href="#">
|
||||
<?php echo $name; ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="<?php echo $first ? 'active first' : ''; ?>" data-frequency-selector="<?php echo $type; ?>" href="#">
|
||||
<?php echo $name; ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php $first = false; endforeach; ?>
|
||||
<?php
|
||||
$first = false;
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -15,12 +15,12 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wu-setup-content-error">
|
||||
<p><?php _e('There are no Plans created in the platform.', 'wp-ultimo'); ?></p><br>
|
||||
<p><?php _e('There are no Plans created in the platform.', 'wp-ultimo'); ?></p><br>
|
||||
</div>
|
||||
|
@ -15,8 +15,8 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
@ -25,117 +25,119 @@ if (!defined('ABSPATH')) {
|
||||
|
||||
/**
|
||||
* Set plan attributes
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
$plan_attrs = '';
|
||||
|
||||
foreach (array(1, 3, 12) as $type) {
|
||||
|
||||
$price = $plan->free ? __('Free!', 'wp-ultimo') : str_replace(wu_get_currency_symbol(), '', wu_format_currency( ( ( (float) $plan->{"price_".$type}) / $type)));
|
||||
$plan_attrs .= " data-price-$type='$price'";
|
||||
|
||||
$price = $plan->free ? __('Free!', 'wp-ultimo') : str_replace(wu_get_currency_symbol(), '', wu_format_currency((((float) $plan->{'price_' . $type}) / $type)));
|
||||
$plan_attrs .= " data-price-$type='$price'";
|
||||
} // end foreach;
|
||||
|
||||
$plan_attrs = apply_filters("wu_pricing_table_plan", $plan_attrs, $plan);
|
||||
$plan_attrs = apply_filters('wu_pricing_table_plan', $plan_attrs, $plan);
|
||||
|
||||
?>
|
||||
|
||||
<div id="plan-<?php echo $plan->get_id(); ?>" data-plan="<?php echo $plan->get_id(); ?>" <?php echo $plan_attrs; ?> class="<?php echo "wu-product-{$plan->get_id()}"; ?> lift wu-plan plan-tier <?php echo $plan->is_featured_plan() ? 'callout' : ''; ?> wu-col-sm-<?php echo $columns; ?> wu-col-xs-12">
|
||||
|
||||
<?php if ($plan->is_featured_plan()) : ?>
|
||||
<?php if ($plan->is_featured_plan()) : ?>
|
||||
|
||||
<h6><?php echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-ultimo'), $plan); ?></h6>
|
||||
<h6><?php echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-ultimo'), $plan); ?></h6>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<h4 class="wp-ui-primary"><?php echo $plan->get_name(); ?></h4>
|
||||
<h4 class="wp-ui-primary"><?php echo $plan->get_name(); ?></h4>
|
||||
|
||||
<!-- Price -->
|
||||
<?php if ($plan->is_free()) : ?>
|
||||
<!-- Price -->
|
||||
<?php if ($plan->is_free()) : ?>
|
||||
|
||||
<h5>
|
||||
<span class="plan-price"><?php _e('Free!', 'wp-ultimo'); ?></span>
|
||||
</h5>
|
||||
<h5>
|
||||
<span class="plan-price"><?php _e('Free!', 'wp-ultimo'); ?></span>
|
||||
</h5>
|
||||
|
||||
<?php elseif ($plan->is_contact_us()) : ?>
|
||||
<?php elseif ($plan->is_contact_us()) : ?>
|
||||
|
||||
<h5>
|
||||
<span class="plan-price-contact-us"><?php echo apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-ultimo')); ?></span>
|
||||
</h5>
|
||||
<h5>
|
||||
<span class="plan-price-contact-us"><?php echo apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-ultimo')); ?></span>
|
||||
</h5>
|
||||
|
||||
<?php else : ?>
|
||||
<?php else : ?>
|
||||
|
||||
<h5>
|
||||
<?php $symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), array('%s%v', '%s %v')); ?>
|
||||
<?php if ($symbol_left) : ?><sup class="superscript"><?php echo wu_get_currency_symbol(); ?></sup><?php endif; ?>
|
||||
<span class="plan-price"><?php echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($plan->price_1)); ?></span>
|
||||
<sub> <?php echo (! $symbol_left ? wu_get_currency_symbol() : '').' '.__('/mo', 'wp-ultimo'); ?></sub>
|
||||
</h5>
|
||||
<h5>
|
||||
<?php $symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), array('%s%v', '%s %v')); ?>
|
||||
<?php
|
||||
if ($symbol_left) :
|
||||
?>
|
||||
<sup class="superscript"><?php echo wu_get_currency_symbol(); ?></sup><?php endif; ?>
|
||||
<span class="plan-price"><?php echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($plan->price_1)); ?></span>
|
||||
<sub> <?php echo (! $symbol_left ? wu_get_currency_symbol() : '') . ' ' . __('/mo', 'wp-ultimo'); ?></sub>
|
||||
</h5>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- end Price -->
|
||||
<?php endif; ?>
|
||||
<!-- end Price -->
|
||||
|
||||
<p class="early-adopter-price"><?php echo $plan->get_description(); ?> </p><br>
|
||||
<p class="early-adopter-price"><?php echo $plan->get_description(); ?> </p><br>
|
||||
|
||||
|
||||
<!-- Feature List Begins -->
|
||||
<ul>
|
||||
<!-- Feature List Begins -->
|
||||
<ul>
|
||||
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Display quarterly and Annually plans, to be hidden
|
||||
*
|
||||
*/
|
||||
$prices_total = array(
|
||||
3 => __('every 3 months', 'wp-ultimo'),
|
||||
12 => __('yearly', 'wp-ultimo'),
|
||||
);
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Display quarterly and Annually plans, to be hidden
|
||||
*/
|
||||
$prices_total = array(
|
||||
3 => __('every 3 months', 'wp-ultimo'),
|
||||
12 => __('yearly', 'wp-ultimo'),
|
||||
);
|
||||
|
||||
foreach ($prices_total as $freq => $string) {
|
||||
|
||||
$text = sprintf(__('%1$s, billed %2$s', 'wp-ultimo'), wu_format_currency($plan->{"price_$freq"}), $string);
|
||||
|
||||
if ($plan->free || $plan->is_contact_us()) echo "<li class='total-price total-price-$freq'>-</li>";
|
||||
|
||||
else echo "<li class='total-price total-price-$freq'>$text</li>";
|
||||
|
||||
} // end foreach;
|
||||
foreach ($prices_total as $freq => $string) {
|
||||
$text = sprintf(__('%1$s, billed %2$s', 'wp-ultimo'), wu_format_currency($plan->{"price_$freq"}), $string);
|
||||
|
||||
/**
|
||||
* Loop and Displays Pricing Table Lines
|
||||
*/
|
||||
foreach ($plan->get_pricing_table_lines() as $key => $line) : ?>
|
||||
if ($plan->free || $plan->is_contact_us()) {
|
||||
echo "<li class='total-price total-price-$freq'>-</li>";
|
||||
} else {
|
||||
echo "<li class='total-price total-price-$freq'>$text</li>";
|
||||
}
|
||||
} // end foreach;
|
||||
|
||||
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
|
||||
/**
|
||||
* Loop and Displays Pricing Table Lines
|
||||
*/
|
||||
foreach ($plan->get_pricing_table_lines() as $key => $line) :
|
||||
?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
|
||||
|
||||
<?php
|
||||
$button_attrubutes = apply_filters('wu_plan_select_button_attributes', "", $plan, $current_plan);
|
||||
$button_label = $current_plan != null && $current_plan->id == $plan->get_id() ? __('This is your current plan', 'wp-ultimo') : __('Select Plan', 'wp-ultimo');
|
||||
$button_label = apply_filters('wu_plan_select_button_label', $button_label, $plan, $current_plan);
|
||||
?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ($plan->is_contact_us()) : ?>
|
||||
<?php
|
||||
$button_attrubutes = apply_filters('wu_plan_select_button_attributes', '', $plan, $current_plan);
|
||||
$button_label = $current_plan != null && $current_plan->id == $plan->get_id() ? __('This is your current plan', 'wp-ultimo') : __('Select Plan', 'wp-ultimo');
|
||||
$button_label = apply_filters('wu_plan_select_button_label', $button_label, $plan, $current_plan);
|
||||
?>
|
||||
|
||||
<li class="wu-cta">
|
||||
<a href="<?php echo $plan->contact_us_link; ?>" class="button button-primary">
|
||||
<?php echo $plan->get_contact_us_label(); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($plan->is_contact_us()) : ?>
|
||||
|
||||
<?php else : ?>
|
||||
<li class="wu-cta">
|
||||
<a href="<?php echo $plan->contact_us_link; ?>" class="button button-primary">
|
||||
<?php echo $plan->get_contact_us_label(); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="wu-cta">
|
||||
<button type="submit" name="plan_id" class="button button-primary button-next" value="<?php echo $plan->get_id(); ?>" <?php echo $button_attrubutes; ?>>
|
||||
<?php echo $button_label; ?>
|
||||
</button>
|
||||
</li>
|
||||
<?php else : ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<li class="wu-cta">
|
||||
<button type="submit" name="plan_id" class="button button-primary button-next" value="<?php echo $plan->get_id(); ?>" <?php echo $button_attrubutes; ?>>
|
||||
<?php echo $button_label; ?>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!-- Feature List Begins -->
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
<!-- Feature List Begins -->
|
||||
|
||||
</div>
|
||||
|
@ -15,8 +15,8 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
@ -34,20 +34,20 @@ $accent_color_2 = wu_color($accent_color->darken(4));
|
||||
|
||||
<style>
|
||||
|
||||
.wu-content-plan .plan-tier h4 {
|
||||
background-color: #<?php echo $primary_color->getHex(); ?>;
|
||||
color: <?php echo $primary_color->isDark() ? "white" : "#333"; ?> !important;
|
||||
}
|
||||
.wu-content-plan .plan-tier h4 {
|
||||
background-color: #<?php echo $primary_color->getHex(); ?>;
|
||||
color: <?php echo $primary_color->isDark() ? 'white' : '#333'; ?> !important;
|
||||
}
|
||||
|
||||
.wu-content-plan .plan-tier.callout h6 {
|
||||
background-color: #<?php echo $accent_color->getHex(); ?>;
|
||||
color: <?php echo $accent_color->isDark() ? "#f9f9f9" : "rgba(39,65,90,.5)"; ?> !important;
|
||||
}
|
||||
.wu-content-plan .plan-tier.callout h6 {
|
||||
background-color: #<?php echo $accent_color->getHex(); ?>;
|
||||
color: <?php echo $accent_color->isDark() ? '#f9f9f9' : 'rgba(39,65,90,.5)'; ?> !important;
|
||||
}
|
||||
|
||||
.wu-content-plan .plan-tier.callout h4 {
|
||||
background-color: #<?php echo $accent_color_2->getHex(); ?>;
|
||||
color: <?php echo $accent_color->isDark() ? "white" : "#333"; ?> !important;
|
||||
}
|
||||
.wu-content-plan .plan-tier.callout h4 {
|
||||
background-color: #<?php echo $accent_color_2->getHex(); ?>;
|
||||
color: <?php echo $accent_color->isDark() ? 'white' : '#333'; ?> !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -58,10 +58,8 @@ $accent_color_2 = wu_color($accent_color->darken(4));
|
||||
/**
|
||||
* Display the frequency selector
|
||||
*/
|
||||
if (!isset($is_shortcode) || !$is_shortcode || $atts['show_selector']) {
|
||||
|
||||
wu_get_template('/legacy/signup/pricing-table/frequency-selector');
|
||||
|
||||
if ( ! isset($is_shortcode) || ! $is_shortcode || $atts['show_selector']) {
|
||||
wu_get_template('/legacy/signup/pricing-table/frequency-selector');
|
||||
} // end if;
|
||||
|
||||
/**
|
||||
@ -69,51 +67,51 @@ if (!isset($is_shortcode) || !$is_shortcode || $atts['show_selector']) {
|
||||
*/
|
||||
|
||||
if (empty($plans)) {
|
||||
wu_get_template('legacy/signup/pricing-table/no-plans');
|
||||
} else {
|
||||
?>
|
||||
|
||||
wu_get_template('legacy/signup/pricing-table/no-plans');
|
||||
<form id="signupform" method="post">
|
||||
|
||||
} else { ?>
|
||||
<?php
|
||||
|
||||
<form id="signupform" method="post">
|
||||
/**
|
||||
* Required: Prints the essential fields necessary to this form to work properly
|
||||
*/
|
||||
$signup->form_fields($current_plan);
|
||||
|
||||
<?php
|
||||
?>
|
||||
|
||||
/**
|
||||
* Required: Prints the essential fields necessary to this form to work properly
|
||||
*/
|
||||
$signup->form_fields($current_plan);
|
||||
<div class="layer plans">
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
<div class="layer plans">
|
||||
/**
|
||||
* Display the plan table
|
||||
*/
|
||||
|
||||
<?php
|
||||
$count = count($plans);
|
||||
$columns = $count == 5 ? '2-4' : 12 / $count;
|
||||
|
||||
/**
|
||||
* Display the plan table
|
||||
*/
|
||||
foreach ($plans as $plan) {
|
||||
wu_get_template(
|
||||
'legacy/signup/pricing-table/plan',
|
||||
array(
|
||||
'plan' => $plan,
|
||||
'count' => $count,
|
||||
'columns' => $columns,
|
||||
'current_plan' => $current_plan,
|
||||
)
|
||||
);
|
||||
} // end foreach;
|
||||
|
||||
$count = count($plans);
|
||||
$columns = $count == 5 ? '2-4' : 12 / $count;
|
||||
?>
|
||||
|
||||
foreach ($plans as $plan) {
|
||||
<div style="clear: both"></div>
|
||||
|
||||
wu_get_template('legacy/signup/pricing-table/plan', array(
|
||||
'plan' => $plan,
|
||||
'count' => $count,
|
||||
'columns' => $columns,
|
||||
'current_plan' => $current_plan,
|
||||
));
|
||||
</div>
|
||||
|
||||
} // end foreach;
|
||||
|
||||
?>
|
||||
|
||||
<div style="clear: both"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
|
||||
<?php } // end if no-plans; ?>
|
||||
|
||||
@ -123,16 +121,16 @@ if (empty($plans)) {
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
(function ($) {
|
||||
$(document).ready(function () {
|
||||
/**
|
||||
* Select the default pricing option
|
||||
*/
|
||||
setTimeout(function() {
|
||||
$('[data-frequency-selector="<?php echo wu_get_setting('default_pricing_option', 1); ?>"]').click();
|
||||
}, 100);
|
||||
(function ($) {
|
||||
$(document).ready(function () {
|
||||
/**
|
||||
* Select the default pricing option
|
||||
*/
|
||||
setTimeout(function() {
|
||||
$('[data-frequency-selector="<?php echo wu_get_setting('default_pricing_option', 1); ?>"]').click();
|
||||
}, 100);
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
</script>
|
||||
|
@ -22,37 +22,31 @@ defined('ABSPATH') || exit;
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-screen.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/screen.php';
|
||||
|
||||
// Load the admin actions removed in wordpress 6.0
|
||||
// Load the admin actions removed in WordPress 6.0
|
||||
$admin_actions = array(
|
||||
'admin_print_scripts' => array(
|
||||
'print_head_scripts' => 20
|
||||
'admin_print_scripts' => array(
|
||||
'print_head_scripts' => 20,
|
||||
),
|
||||
'admin_print_styles' => array(
|
||||
'print_admin_styles' => 20,
|
||||
'admin_print_styles' => array(
|
||||
'print_admin_styles' => 20,
|
||||
),
|
||||
'admin_head' => array(
|
||||
'wp_color_scheme_settings' => 10,
|
||||
'wp_admin_canonical_url' => 10,
|
||||
'wp_site_icon' => 10,
|
||||
'wp_admin_viewport_meta' => 10,
|
||||
'admin_head' => array(
|
||||
'wp_color_scheme_settings' => 10,
|
||||
'wp_admin_canonical_url' => 10,
|
||||
'wp_site_icon' => 10,
|
||||
'wp_admin_viewport_meta' => 10,
|
||||
),
|
||||
'admin_print_footer_scripts' => array(
|
||||
'_wp_footer_scripts' => 10,
|
||||
'_wp_footer_scripts' => 10,
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($admin_actions as $action => $handlers) {
|
||||
|
||||
foreach ($handlers as $handler => $priority) {
|
||||
|
||||
if (!has_action($action, $handler) && function_exists($handler)) {
|
||||
|
||||
if ( ! has_action($action, $handler) && function_exists($handler)) {
|
||||
add_action($action, $handler, $priority);
|
||||
|
||||
} // end foreach;
|
||||
|
||||
} // end foreach;
|
||||
|
||||
} // end foreach;
|
||||
|
||||
do_action('wu_checkout_scripts');
|
||||
@ -61,121 +55,124 @@ do_action('wu_checkout_scripts');
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>
|
||||
<?php echo apply_filters('wu_signup_page_title', sprintf(__('%s - Signup', 'wp-ultimo'), get_bloginfo('Name'), get_bloginfo('Name'))); ?>
|
||||
</title>
|
||||
<title>
|
||||
<?php echo apply_filters('wu_signup_page_title', sprintf(__('%s - Signup', 'wp-ultimo'), get_bloginfo('Name'), get_bloginfo('Name'))); ?>
|
||||
</title>
|
||||
|
||||
<?php // Signup do action, like the default ?>
|
||||
<?php do_action('signup_header'); ?>
|
||||
<?php do_action('login_enqueue_scripts'); ?>
|
||||
<?php do_action('wu_signup_enqueue_scripts'); ?>
|
||||
<?php do_action('admin_print_scripts'); ?>
|
||||
<?php do_action('admin_print_styles'); ?>
|
||||
<?php // Signup do action, like the default ?>
|
||||
<?php do_action('signup_header'); ?>
|
||||
<?php do_action('login_enqueue_scripts'); ?>
|
||||
<?php do_action('wu_signup_enqueue_scripts'); ?>
|
||||
<?php do_action('admin_print_scripts'); ?>
|
||||
<?php do_action('admin_print_styles'); ?>
|
||||
|
||||
<?php //do_action('admin_head'); ?>
|
||||
<?php // do_action('admin_head'); ?>
|
||||
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body class="login wp-core-ui wu-legacy-signup-body">
|
||||
<body class="login wp-core-ui wu-legacy-signup-body">
|
||||
|
||||
<?php while (have_posts()) : the_post();?>
|
||||
<?php
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
?>
|
||||
|
||||
<div class="wu-setup">
|
||||
<div class="wu-setup">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires right after the start body tag is printed
|
||||
*
|
||||
* @since 1.6.2
|
||||
*/
|
||||
do_action('wu_signup_header');
|
||||
<?php
|
||||
/**
|
||||
* Fires right after the start body tag is printed
|
||||
*
|
||||
* @since 1.6.2
|
||||
*/
|
||||
do_action('wu_signup_header');
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<div id="login">
|
||||
<div id="login">
|
||||
|
||||
<h1 id="wu-setup-logo">
|
||||
<a href="<?php echo get_site_url(get_current_site()->blog_id); ?>">
|
||||
<?php printf(__('%s - Signup', 'wp-ultimo'), get_bloginfo('Name')); ?>
|
||||
</a>
|
||||
</h1>
|
||||
<h1 id="wu-setup-logo">
|
||||
<a href="<?php echo get_site_url(get_current_site()->blog_id); ?>">
|
||||
<?php printf(__('%s - Signup', 'wp-ultimo'), get_bloginfo('Name')); ?>
|
||||
</a>
|
||||
</h1>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires before the site sign-up form.
|
||||
*/
|
||||
do_action('wu_before_signup_form');
|
||||
<?php
|
||||
/**
|
||||
* Fires before the site sign-up form.
|
||||
*/
|
||||
do_action('wu_before_signup_form');
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<div class="wu-setup-content wu-content-<?php echo wu_request('step', isset($signup->step) ? $signup->step : 'default'); ?>">
|
||||
<div class="wu-setup-content wu-content-<?php echo wu_request('step', isset($signup->step) ? $signup->step : 'default'); ?>">
|
||||
|
||||
<div name="loginform" id="loginform">
|
||||
<div name="loginform" id="loginform">
|
||||
|
||||
<?php the_content(); ?>
|
||||
<?php the_content(); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires after the sign-up forms, before signup-footer
|
||||
*/
|
||||
do_action('wu_after_signup_form');
|
||||
<?php
|
||||
/**
|
||||
* Fires after the sign-up forms, before signup-footer
|
||||
*/
|
||||
do_action('wu_after_signup_form');
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Nav Links
|
||||
*/
|
||||
wu_get_template('legacy/signup/signup-nav-links', array('signup' => $signup));
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Nav Links
|
||||
*/
|
||||
wu_get_template('legacy/signup/signup-nav-links', array('signup' => $signup));
|
||||
?>
|
||||
|
||||
</div> <!-- /login -->
|
||||
</div> <!-- /login -->
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Navigation Steps
|
||||
*/
|
||||
wu_get_template('legacy/signup/signup-steps-navigation', array('signup' => $signup));
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* Navigation Steps
|
||||
*/
|
||||
wu_get_template('legacy/signup/signup-steps-navigation', array('signup' => $signup));
|
||||
?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires right after the start body tag is printed
|
||||
*
|
||||
* @since 1.6.2
|
||||
*/
|
||||
do_action('wu_signup_footer');
|
||||
<?php
|
||||
/**
|
||||
* Fires right after the start body tag is printed
|
||||
*
|
||||
* @since 1.6.2
|
||||
*/
|
||||
do_action('wu_signup_footer');
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endwhile; ?>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
global $wp_scripts;
|
||||
global $wp_scripts;
|
||||
|
||||
$wp_scripts->print_inline_script('wu-checkout', 'after', true);
|
||||
$wp_scripts->print_inline_script('wu-checkout', 'after', true);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* We also need to print the footer admin scripts, to make sure we are enqueing some of the scripts dependencies
|
||||
* our scripts need in order to function properly
|
||||
*/
|
||||
do_action('admin_print_footer_scripts');
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* We also need to print the footer admin scripts, to make sure we are enqueing some of the scripts dependencies
|
||||
* our scripts need in order to function properly
|
||||
*/
|
||||
do_action('admin_print_footer_scripts');
|
||||
?>
|
||||
|
||||
</body>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -15,8 +15,8 @@
|
||||
* @version 1.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
@ -25,45 +25,50 @@ if (!defined('ABSPATH')) {
|
||||
|
||||
/**
|
||||
* Get Navigational Links
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
$nav_links = apply_filters('wu_signup_form_nav_links', array(
|
||||
home_url() => __('Return to Home', 'wp-ultimo') ,
|
||||
wp_login_url() => sprintf('<strong>%s</strong>', __('Log In', 'wp-ultimo'))
|
||||
));
|
||||
|
||||
if (!isset($signup->step)) {
|
||||
|
||||
return;
|
||||
$nav_links = apply_filters(
|
||||
'wu_signup_form_nav_links',
|
||||
array(
|
||||
home_url() => __('Return to Home', 'wp-ultimo'),
|
||||
wp_login_url() => sprintf('<strong>%s</strong>', __('Log In', 'wp-ultimo')),
|
||||
)
|
||||
);
|
||||
|
||||
if ( ! isset($signup->step)) {
|
||||
return;
|
||||
} // end if;
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($signup->step != 'plan' && $signup->step != 'template') : ?>
|
||||
|
||||
<p id="nav">
|
||||
<p id="nav">
|
||||
|
||||
<?php $i = 1; foreach ($nav_links as $link => $label) : ?>
|
||||
<?php $i = 1; foreach ($nav_links as $link => $label) : ?>
|
||||
|
||||
<a href="<?php echo $link; ?>">
|
||||
<a href="<?php echo $link; ?>">
|
||||
|
||||
<?php echo $label; ?>
|
||||
<?php echo $label; ?>
|
||||
|
||||
</a>
|
||||
</a>
|
||||
|
||||
<?php if ($i < count($nav_links)) {
|
||||
<?php
|
||||
if ($i < count($nav_links)) {
|
||||
|
||||
/**
|
||||
* We need this in order to maintain backwards compatibility with WordPress login page
|
||||
* @since 1.9.2
|
||||
*/
|
||||
echo " | "; $i++;
|
||||
/**
|
||||
* We need this in order to maintain backwards compatibility with WordPress login page
|
||||
*
|
||||
* @since 1.9.2
|
||||
*/
|
||||
echo ' | ';
|
||||
++$i;
|
||||
}
|
||||
?>
|
||||
|
||||
} ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
@ -15,14 +15,12 @@
|
||||
* @version 1.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
if (!$signup) {
|
||||
|
||||
return;
|
||||
|
||||
if ( ! $signup) {
|
||||
return;
|
||||
} // end if;
|
||||
|
||||
?>
|
||||
@ -39,33 +37,30 @@ $percent = 100 / $count;
|
||||
|
||||
<ol class="wu-setup-steps">
|
||||
|
||||
<?php foreach ($ouput_steps as $step) :
|
||||
<?php
|
||||
foreach ($ouput_steps as $step) :
|
||||
$step_key = $step['id'];
|
||||
|
||||
$step_key = $step['id'];
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
$class = '';
|
||||
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
* @var string
|
||||
*/
|
||||
$class = '';
|
||||
if ($step_key === $signup->step) {
|
||||
$class = 'active';
|
||||
} elseif (array_search($signup->step, array_keys($signup->steps)) > array_search($step_key, array_keys($signup->steps))) {
|
||||
$class = 'done';
|
||||
} // end if;
|
||||
|
||||
if ($step_key === $signup->step) {
|
||||
?>
|
||||
|
||||
$class = 'active';
|
||||
<li style="width: <?php echo $percent; ?>%;" class="<?php echo $class; ?>">
|
||||
|
||||
} elseif (array_search($signup->step, array_keys($signup->steps)) > array_search($step_key, array_keys($signup->steps))) {
|
||||
<?php echo esc_html($step['name']); ?>
|
||||
|
||||
$class = 'done';
|
||||
|
||||
} // end if;
|
||||
|
||||
?>
|
||||
|
||||
<li style="width: <?php echo $percent; ?>%;" class="<?php echo $class; ?>">
|
||||
|
||||
<?php echo esc_html($step['name']); ?>
|
||||
|
||||
</li>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
@ -73,14 +68,14 @@ $percent = 100 / $count;
|
||||
|
||||
<?php if ($prev_link = $signup->get_prev_step_link()) : ?>
|
||||
|
||||
<div class="wu-signup-back">
|
||||
<div class="wu-signup-back">
|
||||
|
||||
<a class="wu-signup-back-link" href="<?php echo $prev_link; ?>">
|
||||
<a class="wu-signup-back-link" href="<?php echo $prev_link; ?>">
|
||||
|
||||
<?php _e('← Go Back to Previous Step', 'wp-ultimo'); ?>
|
||||
<?php _e('← Go Back to Previous Step', 'wp-ultimo'); ?>
|
||||
|
||||
</a>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* This is the default template used for steps defined ont he steps array
|
||||
* This is the default template used for steps defined ont he steps array
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/steps/step-default.php.
|
||||
*
|
||||
@ -15,35 +15,34 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wu-setup-content wu-content-<?php echo $signup->step; ?>">
|
||||
|
||||
<!-- <p class="message" style="width: 320px; margin-left: auto; margin-right: auto; box-sizing: border-box;">
|
||||
Please enter your username or email address. You will receive a link to create a new password via email.
|
||||
</p> -->
|
||||
<!-- <p class="message" style="width: 320px; margin-left: auto; margin-right: auto; box-sizing: border-box;">
|
||||
Please enter your username or email address. You will receive a link to create a new password via email.
|
||||
</p> -->
|
||||
|
||||
<form name="loginform" id="loginform" method="post">
|
||||
<form name="loginform" id="loginform" method="post">
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
foreach ($fields as $field_slug => $field) {
|
||||
foreach ($fields as $field_slug => $field) {
|
||||
|
||||
/**
|
||||
* Prints each of our fields using a helper function
|
||||
*/
|
||||
wu_print_signup_field($field_slug, $field, $results);
|
||||
/**
|
||||
* Prints each of our fields using a helper function
|
||||
*/
|
||||
wu_print_signup_field($field_slug, $field, $results);
|
||||
} // end foreach;
|
||||
|
||||
} // end foreach;
|
||||
?>
|
||||
|
||||
?>
|
||||
<?php do_action("wp_ultimo_registration_step_$signup->step"); ?>
|
||||
|
||||
<?php do_action("wp_ultimo_registration_step_$signup->step"); ?>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -15,32 +15,32 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="wu-your-site-block">
|
||||
|
||||
<small><?php _e('Your URL will be', 'wp-ultimo'); ?></small><br>
|
||||
<small><?php _e('Your URL will be', 'wp-ultimo'); ?></small><br>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Change the base, if sub-domain or subdirectory
|
||||
*/
|
||||
$dynamic_part = '<strong id="wu-your-site" v-html="site_url ? site_url : \'yoursite\'">';
|
||||
// This is used on the yoursite.network.com during sign-up
|
||||
$dynamic_part .= isset($signup->results['blogname']) ? $signup->results['blogname'] : __('yoursite', 'wp-ultimo');
|
||||
$dynamic_part .= '</strong>';
|
||||
<?php
|
||||
/**
|
||||
* Change the base, if sub-domain or subdirectory
|
||||
*/
|
||||
$dynamic_part = '<strong id="wu-your-site" v-html="site_url ? site_url : \'yoursite\'">';
|
||||
// This is used on the yoursite.network.com during sign-up
|
||||
$dynamic_part .= isset($signup->results['blogname']) ? $signup->results['blogname'] : __('yoursite', 'wp-ultimo');
|
||||
$dynamic_part .= '</strong>';
|
||||
|
||||
$site_url = preg_replace('#^https?://#', '', WU_Signup()->get_site_url_for_previewer());
|
||||
$site_url = str_replace('www.', '', $site_url);
|
||||
$site_url = preg_replace('#^https?://#', '', WU_Signup()->get_site_url_for_previewer());
|
||||
$site_url = str_replace('www.', '', $site_url);
|
||||
|
||||
$template = is_subdomain_install() ? sprintf('%s.<span id="wu-site-domain" v-html="site_domain">%s</span>', $dynamic_part, $site_url) : sprintf('<span id="wu-site-domain" v-html="site_domain">%s</span>/%s', $site_url, $dynamic_part);
|
||||
$template = is_subdomain_install() ? sprintf('%s.<span id="wu-site-domain" v-html="site_domain">%s</span>', $dynamic_part, $site_url) : sprintf('<span id="wu-site-domain" v-html="site_domain">%s</span>/%s', $site_url, $dynamic_part);
|
||||
|
||||
echo $template;
|
||||
echo $template;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
@ -15,25 +15,30 @@
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
// Get all available plans
|
||||
$plans = wu_get_products(array(
|
||||
'type' => 'plan',
|
||||
));
|
||||
$plans = wu_get_products(
|
||||
array(
|
||||
'type' => 'plan',
|
||||
)
|
||||
);
|
||||
|
||||
// Render the selector
|
||||
wu_get_template('legacy/signup/pricing-table/pricing-table', array(
|
||||
'plans' => $plans,
|
||||
'signup' => $signup,
|
||||
'current_plan' => false,
|
||||
'is_shortcode' => false,
|
||||
'atts' => array(
|
||||
'primary_color' => '#00a1ff', // wu_get_setting('primary-color', '#00a1ff'),
|
||||
'accent_color' => '#78b336', // wu_get_setting('accent-color', '#78b336'),
|
||||
'default_pricing_option' => 1, // wu_get_setting('default_pricing_option', 1),
|
||||
'show_selector' => true,
|
||||
)
|
||||
));
|
||||
wu_get_template(
|
||||
'legacy/signup/pricing-table/pricing-table',
|
||||
array(
|
||||
'plans' => $plans,
|
||||
'signup' => $signup,
|
||||
'current_plan' => false,
|
||||
'is_shortcode' => false,
|
||||
'atts' => array(
|
||||
'primary_color' => '#00a1ff', // wu_get_setting('primary-color', '#00a1ff'),
|
||||
'accent_color' => '#78b336', // wu_get_setting('accent-color', '#78b336'),
|
||||
'default_pricing_option' => 1, // wu_get_setting('default_pricing_option', 1),
|
||||
'show_selector' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user