Initial Commit

This commit is contained in:
David Stone
2024-11-30 18:24:12 -07:00
commit e8f7955c1c
5432 changed files with 1397750 additions and 0 deletions

View File

@ -0,0 +1,70 @@
<?php
/**
* Order bump view.
*
* @since 2.0.0
*/
$duration = $duration ?: 1;
$duration_unit = $duration_unit ?: 'month';
$product = wu_get_product($product['id']);
$product_variation = $product->get_as_variation($duration, $duration_unit);
if ($product_variation !== false) {
$product = $product_variation;
} // end if;
?>
<div class="wu-relative wu-flex wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4 wu-items-center wu-justify-between">
<div class="wu-flex wu-items-center">
<?php if ($display_product_image) : $image = $product->get_featured_image('thumbnail'); ?>
<?php if ($image) : ?>
<div class="wu-w-thumb wu-h-thumb wu-rounded wu-overflow-hidden wu-text-center wu-inline-block wu-mr-4">
<img src="<?php echo esc_attr($image); ?>" class="wu-h-full">
</div>
<?php endif; ?>
<?php endif; ?>
<div class="wu-text-sm">
<span class="wu-font-semibold wu-block wu-text-gray-900"><?php echo empty($name) ? $product->get_name() : $name; ?></span>
<?php if ($display_product_description && $product->get_description()) : ?>
<div class="wu-text-gray-600">
<p class="sm:wu-inline-block wu-my-1">
<?php echo $product->get_description(); ?>
</p>
</div>
<?php endif; ?>
<div class="wu-text-gray-600">
<p class="sm:wu-inline">
<?php echo $product->get_price_description(); ?>
</p>
</div>
</div>
</div>
<div v-if="!($parent.has_product('<?php echo $product->get_id(); ?>') || $parent.has_product('<?php echo $product->get_slug(); ?>'))" class="wu-ml-2">
<a href="#" @click.prevent="$parent.add_product('<?php echo $product->get_id(); ?>')" class="button btn"><?php _e('Add to Cart', 'wp-ultimo'); ?></a>
</div>
<div v-else class="wu-ml-2">
<a href="#" @click.prevent="$parent.remove_product('<?php echo $product->get_id(); ?>', '<?php echo $product->get_slug(); ?>')" class="button btn"><?php _e('Remove', 'wp-ultimo'); ?></a>
<input type="hidden" name="products[]" value="<?php echo $product->get_id(); ?>">
</div>
<div
class="wu-absolute wu--inset-px wu-rounded-lg wu-border-solid wu-border-2 wu-pointer-events-none wu-top-0 wu-bottom-0 wu-right-0 wu-left-0"
:class="($parent.has_product('<?php echo $product->get_id(); ?>') || $parent.has_product('<?php echo $product->get_slug(); ?>'))? 'wu-border-blue-500' : 'wu-border-transparent'"
aria-hidden="true"
>
</div>
</div>

View File

@ -0,0 +1,270 @@
<?php
/**
* Order summary view.
*
* @since 2.0.0
*/
?>
<div id="wu-order-summary-content" class="wu-relative">
<div v-show="!order" class="wu-bg-gray-100 wu-p-4 wu-text-center wu-border wu-border-solid wu-border-gray-300">
<?php _e('Generating Order Summary...', 'wp-ultimo'); ?>
</div>
<div v-if="order" v-cloak>
<table id="wu-order-summary-table" class="wu-w-full wu-mb-0">
<thead>
<tr class="">
<th class="col-description">
<?php _e('Description', 'wp-ultimo'); ?>
</th>
<?php if ($table_columns === 'simple') : ?>
<th class="col-total-gross">
<?php _e('Subtotal', 'wp-ultimo'); ?>
</th>
<?php else : ?>
<th class="col-total-net">
<?php _e('Net Total', 'wp-ultimo'); ?>
</th>
<th class="col-total-vat-percentage">
<?php _e('Discounts', 'wp-ultimo'); ?>
</th>
<th class="col-total-tax">
<?php _e('Tax', 'wp-ultimo'); ?>
</th>
<th class="col-total-gross">
<?php _e('Gross Total', 'wp-ultimo'); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<tr v-if="order.line_items.length === 0">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 2 : 5; ?>" class="col-description">
<?php _e('No products in shopping cart.', 'wp-ultimo'); ?>
</td>
</tr>
<tr v-for="line_item in order.line_items">
<td class="wu-py-2 col-description" v-show="line_item.recurring">
<?php printf(__('Subscription - %s', 'wp-ultimo'), '{{ line_item.title }}'); ?>
<small v-if="line_item.type == 'product'" class="wu-ml-3 wu-text-xs">
<a href="#" class="wu-no-underline" v-on:click.prevent="remove_product(line_item.product_id, line_item.product_slug)">
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</small>
</td>
<td class="wu-py-2 col-description" v-show="!line_item.recurring">
{{ line_item.title }}
<small v-if="line_item.type == 'product'" class="">
<a href="#" class="wu-no-underline" v-on:click.prevent="remove_product(line_item.product_id, line_item.product_slug)">
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</small>
</td>
<?php if ($table_columns === 'simple') : ?>
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
</td>
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }}
</td>
<?php else : ?>
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
</td>
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }}
</td>
<td class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.discount_total) }}
</td>
<td class="wu-py-2 col-total-tax">
{{ wu_format_money(line_item.tax_total) }}
<small v-if="line_item.tax_rate" class="wu-block">
{{ line_item.tax_label }} {{ line_item.tax_rate }}%
</small>
</td>
<td class="wu-py-2 col-total-gross">
{{ wu_format_money(line_item.total) }}
</td>
<?php endif; ?>
</tr>
</tbody>
<tfoot class="">
<?php if ($table_columns === 'simple') : ?>
<tr>
<td>
<?php _e("Discounts", 'wp-ultimo'); ?>
</td>
<td>
{{ wu_format_money(order.totals.total_discounts) }}
</td>
</tr>
<tr>
<td>
<?php _e("Taxes", 'wp-ultimo'); ?>
</td>
<td>
{{ wu_format_money(order.totals.total_taxes) }}
</td>
</tr>
<?php endif; ?>
<tr>
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 1 : 4; ?>">
<strong><?php _e("Today's Grand Total", 'wp-ultimo'); ?></strong>
</td>
<td class="" v-show="order.has_trial">
{{ wu_format_money(0) }}
</td>
<td class="" v-show="!order.has_trial">
{{ wu_format_money(order.totals.total) }}
</td>
</tr>
<tr v-if="order.has_trial">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 1 : 4; ?>">
<small>
<?php printf(__('Total in %1$s - end of trial period.', 'wp-ultimo'), '{{ $moment.unix(order.dates.date_trial_end).format(`LL`) }}'); ?>
</small>
</td>
<td class="">
{{ wu_format_money(order.totals.total) }}
</td>
</tr>
</tfoot>
</table>
<ul class="wu-p-0 wu-m-0 wu-mt-2 wu-list-none wu-order-summary-additional-info wu-text-sm">
<li v-if="!order.has_trial && order.has_recurring">
<?php printf(__('Next fee of %1$s will be billed in %2$s.', 'wp-ultimo'), '{{ wu_format_money(order.totals.recurring.total) }}', "{{ \$moment.unix(order.dates.date_next_charge).format(`LL`) }}"); ?>
</li>
<li class="order-description" v-if="order.totals.total_discounts < 0">
<?php
// translators: 1 is the discount name (e.g. Launch Promo). 2 is the coupon code (e.g PROMO10), 3 is the coupon amount and 4 is the discount total.
printf(__('Discount applied: %1$s - %2$s (%3$s) %4$s', 'wp-ultimo'), '{{ order.discount_code.name }}', '{{ order.discount_code.code }}', '{{ order.discount_code.discount_description }}', '{{ wu_format_money(-order.totals.total_discounts) }}'); ?>
<a class="wu-no-underline wu-ml-2" href="#" v-on:click.prevent="discount_code = ''">
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</li>
</ul>
</div>
</div>

View File

@ -0,0 +1,38 @@
<?php
/**
* Displays the frequency selector for the pricing tables
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/pricing-table/frequency-selector.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 2.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
?>
<ul class="wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-flex wu-rounded wu-relative wu-m-0 wu-mb-4 wu-list-none wu-justify-center">
<?php foreach ($period_options as $index => $period_option) : ?>
<li class="wu-mx-2">
<a
:class="(duration == <?php echo $period_option['duration']; ?> && duration_unit == '<?php echo $period_option['duration_unit']; ?>') || (<?php echo json_encode($index === 0); ?> && duration === '') ? 'wu-font-semibold active' : ''"
v-on:click.prevent="duration = <?php echo $period_option['duration']; ?>; duration_unit = '<?php echo $period_option['duration_unit']; ?>'"
href="#"
>
<?php echo $period_option['label']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>

View File

@ -0,0 +1,39 @@
<?php
/**
* Displays the frequency selector for the pricing tables
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/pricing-table/frequency-selector.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
?>
<div class="wu-mx-auto wu-text-center wu-mb-4">
<ul class="wu-plans-frequency-selector">
<?php foreach ($period_options as $index => $period_option) : ?>
<li>
<a class="wu-text-center" :class="(duration == <?php echo $period_option['duration']; ?> && duration_unit == '<?php echo $period_option['duration_unit']; ?>') || (<?php echo json_encode($index === 0); ?> && duration === '') ? 'active' : ''" v-on:click.prevent="duration = <?php echo $period_option['duration']; ?>; duration_unit = '<?php echo $period_option['duration_unit']; ?>'" href="#">
<?php echo $period_option['label']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,373 @@
<?php
/**
* Template File: Basic Pricing Table.
*
* To see what methods are available on the product variable, @see inc/models/class-products.php.
*
* This template can also be override using template overrides.
* See more here: https://help.wpultimo.com/article/335-template-overrides.
*
* @since 2.0.0
* @param array $products List of product objects.
* @param string $name ID of the field.
* @param string $label The field label.
*/
$products_to_reduce = array_merge(array(false), $products);
$first_recurring_product = array_reduce($products_to_reduce, function($chosen_product, $product) {
if ($product && $product->is_recurring() && $chosen_product == false) {
$chosen_product = $product;
} // end if;
return $chosen_product;
});
$legacy_mode = array_reduce($products_to_reduce, function($all_have_same_duration, $product) use ($first_recurring_product) {
if ($product && $product->is_recurring()) {
$all_have_same_duration = $first_recurring_product->get_recurring_description() == $product->get_recurring_description();
} // end if;
return $all_have_same_duration;
});
wp_add_inline_script('wu-checkout', sprintf('
/**
* Force different durations.
*/
window.wu_force_different_durations = %s;
window.wu_legacy_mode = %s;
', json_encode($force_different_durations), json_encode($legacy_mode)), 'after');
if ($first_recurring_product !== null) {
wp_add_inline_script('wu-checkout', sprintf("
/**
* Add durations if necessary.
*/
wp.hooks.addFilter('wu_before_form_init', 'next-press/wp-ultimo', function(data) {
data.wu_force_different_durations = wu_force_different_durations;
data.wu_legacy_mode = wu_legacy_mode;
if (!data.duration && !wu_force_different_durations) {
data.duration = %s;
} // end if;
if (!data.duration_unit && !wu_force_different_durations) {
data.duration_unit = %s;
} // end if;
return data;
});
", json_encode($first_recurring_product->get_duration()), json_encode($first_recurring_product->get_duration_unit())), 'after');
}
?>
<?php if (empty($products)) : ?>
<div class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4">
<?php _e('No Products Found.', 'wp-ultimo'); ?>
</div>
<?php else : ?>
<div class="wu-content-plan">
<div class="layer plans wu-overflow-hidden wu-flex">
<?php foreach ($products as $product) : ?>
<div
id="plan-<?php echo esc_attr($product->get_id()); ?>"
class="<?php echo "wu-product-{$product->get_id()}"; ?> lift wu-plan plan-tier wu-flex-1 <?php echo esc_attr($product->is_featured_plan() ? 'callout' : ''); ?> wu-flex wu-flex-col wu-justify-between"
v-show="wu_force_different_durations || (duration && wu_legacy_mode) || (( (!duration) || duration == <?php echo $product->get_duration(); ?> && duration_unit == '<?php echo $product->get_duration_unit(); ?>' ) || <?php echo json_encode($product->get_pricing_type() !== 'paid'); ?>)"
>
<div class="wu-relative">
<?php if ($product->is_featured_plan()) : ?>
<h6>
<?php
/**
* Featured tag.
*/
echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-ultimo'), $product);
?>
</h6>
<?php endif; ?>
<h4 class="wp-ui-primary">
<?php echo $product->get_name(); ?>
</h4>
<?php
/**
* Case Free
*/
if ($product->get_pricing_type() === 'free') :
?>
<!-- Price -->
<h5>
<span class="plan-price">
<?php _e('Free!', 'wp-ultimo'); ?>
</span>
</h5>
<?php
/**
* Case Free
*/
elseif ($product->get_pricing_type() === 'contact_us') :
?>
<!-- Price -->
<h5>
<span class="plan-price">
<?php echo apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-ultimo')); ?>
</span>
</h5>
<?php else : ?>
<!-- Price -->
<h5>
<?php
/**
* Price display.
*/
$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($product->get_currency()); ?>
</sup>
<?php endif; ?>
<span class="plan-price" v-if="wu_force_different_durations || (duration == <?php echo $product->get_duration(); ?> && duration_unit == '<?php echo $product->get_duration_unit(); ?>')">
<?php
$n = $product->get_amount();
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
?>
</span>
<?php foreach (array(3, 12) as $freq) :
$price_variation = $product->get_price_variation($freq, 'month');
if (!$price_variation) {
continue;
} // end if;
?>
<span class="plan-price" v-cloak v-if="duration == <?php echo $price_variation['duration']; ?> && duration_unit == '<?php echo $price_variation['duration_unit']; ?>'">
<?php
$n = $price_variation ? $price_variation['monthly_amount'] : false;
if ($n) {
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
} else {
echo '--';
} // end if;
?>
</span>
<?php endforeach;?>
<sub v-if="1 == <?php echo $product->get_duration(); ?> && 'month' == '<?php echo $product->get_duration_unit(); ?>'">
<?php
/**
* Period Unit.
*/
$symbol = $product->is_recurring() ? __('/mo', 'wp-ultimo') : '';
echo (!$symbol_left ? wu_get_currency_symbol() : '').' '.$symbol;
?>
</sub>
<sub v-else>
<?php
/**
* Period Unit.
*/
$symbol = $product->is_recurring() ? $product->get_recurring_description() : '';
echo (!$symbol_left ? wu_get_currency_symbol() : '').' '.$symbol;
?>
</sub>
</h5>
<!-- end Price -->
<?php endif; ?>
<p class="early-adopter-price">
<?php echo $product->get_description(); ?>
</p>
</div>
<br>
<!-- 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'),
);
foreach ($prices_total as $freq => $string) {
$price_variation = $product->get_price_variation($freq, 'month');
if (!$price_variation || $product->get_pricing_type() == 'free' || $product->get_pricing_type() == 'contact_us') {
echo "<li v-cloak v-show='duration == ".$freq."' class='total-price total-price-$freq'>-</li>";
} else {
$text = sprintf(__('%1$s, billed %2$s', 'wp-ultimo'), wu_format_currency($price_variation['amount']), $string);
$extra_check_for_annual = '';
if ($freq === 12) {
$extra_check_for_annual = ' || (duration == "1" && duration_unit == "year")';
} // end if;
echo "<li v-cloak v-show='duration == ".$freq.$extra_check_for_annual."' class='total-price total-price-$freq'>$text</li>";
} // end if;
} // end foreach;
?>
<?php foreach ($product->get_pricing_table_lines() as $key => $line) : ?>
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
<?php endforeach; ?>
<li class="wu-cta">
<button
v-if="<?php echo json_encode($product->get_pricing_type() !== 'contact_us'); ?>"
v-on:click="add_plan(<?php echo $product->get_id(); ?>)"
type="button"
name="products[]"
value="<?php echo $product->get_id(); ?>"
class="button button-primary button-next"
>
<?php _e('Select Plan', 'wp-ultimo'); ?>
</button>
<button
v-else
v-on:click="open_url('<?php echo esc_url($product->get_contact_us_link()); ?>', '_blank');" type="button"
name="products[]"
value="<?php echo $product->get_id(); ?>"
class="button button-primary button-next"
>
<?php _e('Select Plan', 'wp-ultimo'); ?>
</button>
</li>
</ul>
<!-- Feature List Ends -->
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>

View File

@ -0,0 +1,71 @@
<?php
/**
* List Template field view.
*
* @since 2.0.0
*/
/**
* Deal with different pricing options
*/
foreach ($products as $index => &$_product) {
$_product = wu_get_product($_product['id']);
$product_variation = $_product->get_as_variation($duration, $duration_unit);
if ($product_variation === false && !$force_different_durations) {
unset($products[$index]);
$_product = $product_variation;
} // end if;
} // end foreach;
?>
<div class="">
<div class="wu-grid wu-grid-flow-row wu-gap-4 <?php echo $classes; ?>">
<?php foreach ($products as $product) : ?>
<label
id="wu-product-<?php echo $product->get_id(); ?>"
class="wu-relative wu-block wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4 wu-cursor-pointer hover:wu-border-gray-400 sm:wu-flex sm:wu-justify-between focus-within:wu-ring-1 focus-within:wu-ring-offset-2 focus-within:wu-ring-indigo-500">
<input v-if="<?php echo json_encode($product->get_pricing_type() !== 'contact_us'); ?>" v-on:click="$parent.add_plan(<?php echo $product->get_id(); ?>)" type="checkbox" name="products[]" value="<?php echo $product->get_id(); ?>" class="screen-reader-text wu-hidden">
<input v-else v-on:click="$parent.open_url('<?php echo esc_url($product->get_contact_us_link()); ?>', '_blank');" type="checkbox" name="products[]" value="<?php echo $product->get_id(); ?>" class="screen-reader-text wu-hidden">
<div class="wu-flex wu-items-center">
<div class="wu-text-sm">
<span id="server-size-0-label" class="wu-font-semibold wu-block wu-text-gray-900">
<?php echo $product->get_name(); ?>
</span>
<div id="server-size-0-description-0" class="wu-text-gray-600">
<p class="sm:wu-inline">
<?php echo $product->get_description(); ?>
</p>
</div>
</div>
</div>
<div id="server-size-0-description-1" class="wu-mt-2 wu-flex wu-text-md sm:wu-mt-0 sm:wu-block sm:wu-ml-4 sm:wu-text-right">
<div class="wu-font-semibold wu-text-gray-900"><?php echo $product->get_formatted_amount(); ?></div>
<div class="wu-ml-1 wu-text-sm wu-text-gray-500 sm:wu-ml-0"><?php echo $product->get_recurring_description(); ?></div>
</div>
<div
class="wu-absolute wu--inset-px wu-rounded-lg wu-border-solid wu-border-2 wu-pointer-events-none wu-top-0 wu-bottom-0 wu-right-0 wu-left-0"
:class="$parent.has_product(<?php echo $product->get_id(); ?>) || $parent.has_product('<?php echo $product->get_slug(); ?>') ? 'wu-border-blue-500' : 'wu-border-transparent'"
aria-hidden="true"
>
</div>
</label>
<?php endforeach; ?>
</div>
</div>

View File

@ -0,0 +1,62 @@
<?php
/**
* Displays the navigation part on the bottom of the page
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/signup-steps-navigation.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
<!-- This example requires Tailwind CSS v2.0+ -->
<nav aria-label="<?php esc_attr_e('Progress', 'wp-ultimo'); ?>">
<ul class="wu-clean-steps wu-list-none md:wu-flex wu-p-0 wu--mx-2 wu-my-4">
<?php foreach ($steps as $index => $step) :
$step_key = $step['id'];
/**
* Class element of the Step Status Bar
* @var string
*/
$container_class = '';
$color = 'gray';
if ($step_key === $current_step) {
$color = 'blue';
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
$container_class = 'wu-opacity-50';
$color = 'blue';
} // end if;
?>
<li class="wu-py-0 md:wu-flex-1 wu-px-2 <?php echo esc_attr($container_class); ?>">
<span class="wu-h-2 wu-block wu-mb-2 wu-bg-<?php echo esc_attr($color); ?>-500">&nbsp;</span>
<span class="wu-block wu-text-2xs wu-font-medium wu-tracking-wide wu-uppercase wu-text-<?php echo esc_attr($color); ?>-500"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
<span class="wu-block wu-text-sm wu-font-medium wu-text-<?php echo esc_attr($color); ?>-600"><?php echo $step['name']; ?></span>
</li>
<?php endforeach; ?>
</ul>
</nav>

View File

@ -0,0 +1,56 @@
<?php
/**
* Displays the navigation part on the bottom of the page
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/signup-steps-navigation.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
<ol class="wu-setup-steps wu-flex">
<?php foreach ($steps as $index => $step) :
$step_key = $step['id'];
/**
* Class element of the Step Status Bar
* @var string
*/
$class = '';
if ($step_key === $current_step) {
$class = 'active';
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
$class = 'done';
} // end if;
?>
<li class="<?php echo $class; ?> wu-flex-1">
<?php echo esc_html($step['name']); ?>
</li>
<?php endforeach; ?>
</ol>

View File

@ -0,0 +1,60 @@
<?php
/**
* Displays the navigation part on the bottom of the page
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/signup-steps-navigation.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
<!-- This example requires Tailwind CSS v2.0+ -->
<nav aria-label="<?php esc_attr_e('Progress', 'wp-ultimo'); ?>">
<ul class="wu-minimal-steps">
<?php foreach ($steps as $index => $step) :
$step_key = $step['id'];
/**
* Class element of the Step Status Bar
* @var string
*/
$class = '';
if ($step_key === $current_step) {
$class = 'step-current';
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
$class = 'step-done';
} // end if;
?>
<li class="<?php echo esc_attr($class); ?>">
<span class="wu-minimal-steps-bar">&nbsp;</span>
<span class="wu-minimal-steps-step-count"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
<span class="wu-minimal-steps-step-label"><?php echo $step['name']; ?></span>
</li>
<?php endforeach; ?>
</ul>
</nav>

View File

@ -0,0 +1,147 @@
<?php
/**
* Template File: Basic Pricing Table.
*
* To see what methods are available on the product variable, @see inc/models/class-products.php.
*
* This template can also be overridden using template overrides.
* See more here: https://help.wpultimo.com/article/335-template-overrides.
*
* @since 2.0.0
* @param array $products List of product objects.
* @param string $name ID of the field.
* @param string $label The field label.
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
if (isset($should_display) && !$should_display) {
?>
<div id="wu-site-template-container"></div>
<?php
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
$categories = isset($categories) ? $categories : array();
$customer_sites_category = __('Your Sites', 'wp_ultimo');
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : array();
?>
<div id="wu-site-template-container">
<ul id="wu-site-template-filter" class="wu-bg-white wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-flex wu-rounded wu-relative wu-m-0 wu-mb-4 wu-list-none">
<li class="wu-site-template-filter-all wu-mx-2 wu-my-0">
<a
href="#"
data-category=""
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = ''"
>
<?php _e('All', 'wp-ultimo'); ?>
</a>
</li>
<?php if (!empty($customer_sites)) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?> wu-mx-2 wu-my-0">
<a
href="#"
data-category="<?php echo esc_attr($customer_sites_category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
><?php echo $customer_sites_category; ?></a>
</li>
<?php endif; ?>
<?php if (isset($categories) && $categories) : ?>
<?php foreach ($categories as $category) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?> wu-mx-2 wu-my-0">
<a
href="#"
data-category="<?php echo esc_attr($category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
><?php echo $category; ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<div id="wu-site-template-container-grid" class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo isset($cols) ? $cols : '3'; ?> wu-gap-4">
<?php foreach ($sites as $site_template) : ?>
<?php if ($site_template->get_type() !== 'site_template' && !in_array($site_template->get_id(), $customer_sites, true)) { continue; } ?>
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site_template->get_categories(), !$is_template ? array($customer_sites_category) : array()); ?>
<div
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
class="wu-bg-white wu-border-solid wu-border wu-border-gray-300 wu-shadow-sm wu-p-4 wu-rounded wu-relative"
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
v-cloak
>
<div class="wu-site-template-image-container wu-relative">
<a
title="<?php esc_attr_e('View Template Preview', 'wp-ultimo'); ?>"
class="wu-site-template-selector wu-cursor-pointer wu-no-underline"
<?php echo $is_template ? $site_template->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site_template->get_active_site_url()); ?>
>
<img class="wu-site-template-image wu-w-full wu-border-solid wu-border wu-border-gray-300 wu-mb-4 wu-bg-white" src="<?php echo esc_attr($site_template->get_featured_image()); ?>" alt="<?php echo $site_template->get_title(); ?>">
</a>
</div>
<h3 class="wu-site-template-title wu-text-lg wu-font-semibold">
<?php echo $site_template->get_title(); ?>
</h3>
<p class="wu-site-template-description wu-text-sm">
<?php echo $site_template->get_description(); ?>
</p>
<div class="wu-mt-4">
<button v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site_template->get_id()); ?>" type="button" class="wu-site-template-selector button btn button-primary btn-primary wu-w-full wu-text-center wu-cursor-pointer">
<span v-if="$parent.template_id == <?php echo esc_attr($site_template->get_id()); ?>"><?php _e('Selected', 'wp-ultimo'); ?></span>
<span v-else><?php _e('Select', 'wp-ultimo'); ?></span>
</button>
</div>
</div>
<?php endforeach; ?>
</div>
</div>

View File

@ -0,0 +1,265 @@
<?php
/**
* Template File: Basic Pricing Table.
*
* To see what methods are available on the product variable, @see inc/models/class-products.php.
*
* This template can also be overridden using template overrides.
* See more here: https://help.wpultimo.com/article/335-template-overrides.
*
* @since 2.0.0
* @param array $products List of product objects.
* @param string $name ID of the field.
* @param string $label The field label.
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
if (!$should_display) {
echo "<div></div>";
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
$categories = isset($categories) ? $categories : array();
$customer_sites_category = __('Your Sites', 'wp_ultimo');
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : array();
?>
<?php if (empty($sites)) : ?>
<div
class="wu-text-center wu-bg-gray-100 wu-rounded wu-uppercase wu-font-semibold wu-text-xs wu-text-gray-700 wu-p-4"
>
<?php _e('No Site Templates Found.', 'wp-ultimo'); ?>
</div>
<?php else : ?>
<div class="themes-php wu-styling">
<div class="wrap wu-template-selection">
<?php
/**
* Allow developers to hide the title.
*/
if (apply_filters('wu_step_template_display_header', true)) :
?>
<h2>
<?php _e('Pick your Template', 'wp-ultimo'); ?>
<span class="title-count theme-count">
<?php echo count($sites); ?>
</span>
</h2>
<?php endif; ?>
<div class="wp-filter">
<div class="wp-filter-responsive">
<h4><?php _e('Template Categories', 'wp-ultimo'); ?></h4>
<select class="">
<option value="">
<?php _e('All Templates', 'wp-ultimo'); ?>
</option>
<?php if (!empty($customer_sites)) : ?>
<option value="<?php echo esc_attr($customer_sites_category); ?>">
<?php echo $customer_sites_category; ?>
</option>
<?php endif; ?>
<?php foreach ($categories as $category) : ?>
<option value="<?php echo esc_attr($category); ?>">
<?php echo $category; ?>
</option>
<?php endforeach; ?>
</select>
</div>
<ul class="filter-links wp-filter-template">
<li class="selector-inactive">
<a
href="#"
data-category=""
:class="$parent.template_category === '' ? 'current' : ''"
v-on:click.prevent="$parent.template_category = ''"
>
<?php _e('All Templates', 'wp-ultimo'); ?>
</a>
</li>
<?php if (!empty($customer_sites)) : ?>
<li class="selector-inactive">
<a
href="#"
data-category="<?php echo esc_attr($customer_sites_category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
>
<?php echo $customer_sites_category; ?>
</a>
</li>
<?php endif; ?>
<?php foreach ($categories as $category) : ?>
<li class="selector-inactive">
<a
href="#"
data-category="<?php echo esc_attr($category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
>
<?php echo $category; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="theme-browser rendered">
<div class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo $cols; ?> wu-gap-4 wp-clearfix">
<?php $i = 0; foreach ($sites as $site) : ?>
<?php if ($site->get_type() !== 'site_template' && !in_array($site->get_id(), $customer_sites, true)) { continue; } ?>
<?php $is_template = $site->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site->get_categories(), !$is_template ? array($customer_sites_category) : array()) ?>
<div
class="theme"
tabindex="<?php echo $i; ?>"
aria-describedby="<?php echo $site->get_id(); ?>-action <?php echo $site->get_id(); ?>-name"
data-slug="<?php echo $site->get_id(); ?>"
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
v-cloak
>
<div class="theme-screenshot">
<img
src="<?php echo $site->get_featured_image(); ?>"
alt="<?php echo $site->get_title(); ?>"
>
</div>
<a
<?php echo $is_template ? $site->get_preview_url_attrs() : sprintf('href="%s" target="_blank"', $site->get_active_site_url()); ?>
class="more-details"
id="<?php echo $site->get_id(); ?>-action"
>
<?php $is_template ? _e('View Template', 'wp-ultimo') : _e('View Site', 'wp-ultimo'); ?>
</a>
<div class="wu-flex theme-name-header wu-items-center wu-relative">
<h2 class="theme-name wu-flex-grow wu-h-full" id="<?php echo $site->get_id(); ?>-name">
<?php echo $site->get_title(); ?>
</h2>
<div class="theme-actions wu-flex">
<button
class="button button-primary"
type="button"
v-on:click.prevent="$parent.template_id = <?php echo esc_attr($site->get_id()); ?>"
>
<span v-if="$parent.template_id == <?php echo esc_attr($site->get_id()); ?>"><?php _e('Selected', 'wp-ultimo'); ?></span>
<span v-else><?php _e('Select', 'wp-ultimo'); ?></span>
</button>
</div>
</div>
</div>
<?php
$i++;
endforeach;
?>
</div>
</div>
<div class="theme-overlay"></div>
<p class="no-themes">
<?php _e('No Templates Found', 'wp-ultimo'); ?>
</p>
</div>
</div>
<?php endif; ?>

View File

@ -0,0 +1,141 @@
<?php
/**
* Displays the frequency selector for the pricing tables
*
* This template can be overridden by copying it to yourtheme/wp-ultimo/signup/pricing-table/frequency-selector.php.
*
* HOWEVER, on occasion WP Ultimo will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @author NextPress
* @package WP_Ultimo/Views
* @version 1.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
if (!$should_display) {
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
$categories = isset($categories) ? $categories : array();
$customer_sites_category = __('Your Sites', 'wp_ultimo');
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : array();
?>
<div id="wu-site-template-container">
<ul id="wu-site-template-filter">
<li class="wu-site-template-filter-all">
<a
href="#"
data-category=""
:class="$parent.template_category === '' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = ''"
>
<?php _e('All', 'wp-ultimo'); ?>
</a>
</li>
<?php if (!empty($customer_sites)) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($customer_sites_category)); ?>">
<a
href="#"
data-category="<?php echo esc_attr($customer_sites_category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($customer_sites_category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($customer_sites_category); ?>'"
><?php echo $customer_sites_category; ?></a>
</li>
<?php endif; ?>
<?php if (isset($categories) && $categories) : ?>
<?php foreach ($categories as $category) : ?>
<li class="wu-site-template-filter-<?php echo esc_attr(sanitize_title($category)); ?>">
<a
href="#"
data-category="<?php echo esc_attr($category); ?>"
:class="$parent.template_category === '<?php echo esc_attr($category); ?>' ? 'current wu-font-semibold' : ''"
v-on:click.prevent="$parent.template_category = '<?php echo esc_attr($category); ?>'"
><?php echo $category; ?></a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<div id="wu-site-template-container-grid">
<?php foreach ($sites as $site_template) : ?>
<?php if ($site_template->get_type() !== 'site_template' && !in_array($site_template->get_id(), $customer_sites, true)) { continue; } ?>
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site_template->get_categories(), !$is_template ? array($customer_sites_category) : array()); ?>
<div
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
v-show="!$parent.template_category || <?php echo esc_attr(json_encode($categories)); ?>.join(',').indexOf($parent.template_category) > -1"
v-cloak
>
<img class="wu-site-template-image" src="<?php echo esc_attr($site_template->get_featured_image()); ?>" alt="<?php echo $site_template->get_title(); ?>">
<h3 class="wu-site-template-title">
<?php echo $site_template->get_title(); ?>
</h3>
<p class="wu-site-template-description">
<?php echo $site_template->get_description(); ?>
</p>
<div class="wu-site-template-preview-block">
<a class="wu-site-template-selector" <?php echo $site_template->get_preview_url_attrs(); ?>>
<?php _e('View Template Preview', 'wp-ultimo'); ?>
</a>
</div>
<label for="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>">
<input id="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>" type="radio" name="template_id" v-model="$parent.template_id" value="<?php echo esc_attr($site_template->get_id()); ?>" />
<a class="wu-site-template-selector" @click.prevent="" href="#">
<?php _e('Select this Template', 'wp-ultimo'); ?>
</a>
</label>
</div>
<?php endforeach; ?>
</div>
</div>