Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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(); ?>&nbsp;</p><br>
<p class="early-adopter-price"><?php echo $plan->get_description(); ?>&nbsp;</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>

View File

@ -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>