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

@ -7,26 +7,26 @@
?>
<div class="wu-styling">
<p>Thank you for your membership to wphunt.org. Your Teste 2 membership is now active.</p>
<p>Thank you for your membership to wphunt.org. Your Teste 2 membership is now active.</p>
<p>Below are details about your membership account and a receipt for your initial membership invoice. A welcome email with a copy of your initial membership invoice has been sent to arindo@wpultimo.com.</p>
<p>Below are details about your membership account and a receipt for your initial membership invoice. A welcome email with a copy of your initial membership invoice has been sent to arindo@wpultimo.com.</p>
<p>Extra message</p>
<p>Extra message</p>
<h3>
<h3>
Invoice #DF232BD72B on May 2, 2020
</h3>
<a class="pmpro_a-print" href="javascript:window.print()">Print</a>
<a class="pmpro_a-print" href="javascript:window.print()">Print</a>
<ul>
<ul>
<li><strong>Account:</strong> aanduque (arindo@wpultimo.com)</li>
<li><strong>Membership Level:</strong> Teste 2</li>
</ul>
<hr>
<hr>
<div class="pmpro_invoice_details">
<div class="pmpro_invoice_details">
<div class="pmpro_invoice-billing-address">
<strong>Billing Address</strong>
<p>Quynn Mullins<br>
@ -49,14 +49,14 @@
</div>
<hr>
<hr>
<nav id="nav-below" class="navigation" role="navigation">
<nav id="nav-below" class="navigation" role="navigation">
<div class="nav-next alignright">
<div class="nav-next alignright">
<a href="https://wphunt.org/?page_id=28">View Your Membership Account →</a>
</div>
</nav>
</nav>
</div>

View File

@ -7,40 +7,48 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>[]" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>[]" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<?php echo $option_name; ?>
<?php echo $option_name; ?>
</label>
</label>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,28 +7,32 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</label>
</label>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,59 +7,70 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<span class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
<span class="wu-block wu-w-full <?php echo esc_attr($field->classes); ?>">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form($field->id, $field->fields, array(
'views' => 'checkout/fields',
'classes' => 'wu-flex wu-my-1',
'field_wrapper_classes' => 'wu-bg-transparent',
'wrap_tag' => 'span',
'step' => (object) array(
'classes' => '',
),
));
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form(
$field->id,
$field->fields,
array(
'views' => 'checkout/fields',
'classes' => 'wu-flex wu-my-1',
'field_wrapper_classes' => 'wu-bg-transparent',
'wrap_tag' => 'span',
'step' => (object) array(
'classes' => '',
),
)
);
$form->render();
$form->render();
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->desc) : ?>
<?php if ($field->desc) : ?>
<span class="wu-mt-2 wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t wu-border-l wu-border-b wu-border-r wu-text-2xs wu-py-2 wu-p-2">
<span class="wu-mt-2 wu-block wu-bg-gray-100 wu-rounded wu-border-solid wu-border-gray-400 wu-border-t wu-border-l wu-border-b wu-border-r wu-text-2xs wu-py-2 wu-p-2">
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</span>
</span>
<?php endif; ?>
</span>
</span>
</div>

View File

@ -8,15 +8,15 @@
<?php if (is_array($field->value)) : ?>
<?php foreach ($field->value as $index => $value) : ?>
<?php foreach ($field->value as $index => $value) : ?>
<input id="field-<?php echo esc_attr($field->id).'-'.esc_attr($index); ?>" name="<?php echo esc_attr($field->id); ?>[]" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input id="field-<?php echo esc_attr($field->id) . '-' . esc_attr($index); ?>" name="<?php echo esc_attr($field->id); ?>[]" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php endforeach; ?>
<?php endforeach; ?>
<?php else : ?>
<input id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php endif; ?>
@ -24,10 +24,14 @@
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>

View File

@ -8,46 +8,58 @@
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block wu-w-full">
<div class="wu-block wu-w-full">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
/**
* Adds the partial description template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-description', array(
'field' => $field,
));
/**
* Adds the partial description template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-description',
array(
'field' => $field,
)
);
?>
?>
<div class="wu-block wu-w-full wu-mt-4">
<div class="wu-block wu-w-full wu-mt-4">
<?php echo $field->content; ?>
<?php echo $field->content; ?>
</div>
</div>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>
</div>
</div>

View File

@ -8,6 +8,6 @@
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</div>

View File

@ -7,49 +7,57 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php if ($field->meter) : ?>
<?php if ($field->meter) : ?>
<span class="wu-block">
<span class="wu-block">
<span id="pass-strength-result" class="wu-py-2 wu-px-4 wu-bg-gray-100 wu-block wu-text-sm">
<span id="pass-strength-result" class="wu-py-2 wu-px-4 wu-bg-gray-100 wu-block wu-text-sm">
<?php _e('Strength Meter', 'wp-ultimo'); ?>
<?php _e('Strength Meter', 'wp-ultimo'); ?>
</span>
</span>
</span>
</span>
<?php endif; ?>
<?php endif; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
<!--
<div class="wu-border-red-300"></div>
<div class="wu-border-yellow-300"></div>
-->
<!--
<div class="wu-border-red-300"></div>
<div class="wu-border-yellow-300"></div>
-->
</div>

View File

@ -10,70 +10,79 @@ $active_gateways = wu_get_active_gateway_as_options();
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" v-cloak v-show="order && order.should_collect_payment" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach ($active_gateways as $option_value => $option_name) : ?>
<?php foreach ($active_gateways as $option_value => $option_name) : ?>
<?php if (count($active_gateways) === 1) : ?>
<?php if (count($active_gateways) === 1) : ?>
<input
id="field-gateway"
type="hidden"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
<?php echo $field->get_html_attributes(); ?>
>
<input
id="field-gateway"
type="hidden"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
<?php echo $field->get_html_attributes(); ?>
>
<?php else : ?>
<?php else : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input
id="field-gateway-<?php echo esc_attr($option_value); ?>"
type="radio"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
class="<?php echo trim($field->classes); ?>"
<?php echo $field->get_html_attributes(); ?>
<?php checked($field->value == $option_value); ?>
>
<input
id="field-gateway-<?php echo esc_attr($option_value); ?>"
type="radio"
name="gateway"
value="<?php echo esc_attr($option_value); ?>"
v-model="gateway"
class="<?php echo trim($field->classes); ?>"
<?php echo $field->get_html_attributes(); ?>
<?php checked($field->value == $option_value); ?>
>
<?php echo $option_name; ?>
<?php echo $option_name; ?>
</label>
</label>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
/**
* Load Gateway fields
* @since 2.0.0
*/
do_action('wu_checkout_gateway_fields');
/**
* Load Gateway fields
*
* @since 2.0.0
*/
do_action('wu_checkout_gateway_fields');
?>
?>
</div>

View File

@ -7,40 +7,48 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach (wu_get_plans() as $option) : ?>
<?php foreach (wu_get_plans() as $option) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option->get_id()); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option->get_id()); ?>">
<input id="field-products-<?php echo esc_attr($option->get_id()); ?>" type="checkbox" name="products[]" value="<?php echo esc_attr($option->get_id()); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option->get_id()); ?> v-model="products">
<input id="field-products-<?php echo esc_attr($option->get_id()); ?>" type="checkbox" name="products[]" value="<?php echo esc_attr($option->get_id()); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option->get_id()); ?> v-model="products">
<?php echo $option->get_name(); ?>
<?php echo $option->get_name(); ?>
</label>
</label>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,40 +7,48 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<?php foreach ($field->options as $option_value => $option_name) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>-<?php echo esc_attr($option_value); ?>">
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<input id="field-gateway-<?php echo esc_attr($option_value); ?>" type="radio" name="<?php echo esc_attr($field->id); ?>" value="<?php echo esc_attr($option_value); ?>" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value == $option_value); ?>>
<?php echo $option_name; ?>
<?php echo $option_name; ?>
</label>
</label>
<?php endforeach; ?>
<?php endforeach; ?>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,61 +7,69 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<select
class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>"
id="field-<?php echo esc_attr($field->id); ?>"
name="<?php echo esc_attr($field->id); ?>"
value="<?php echo esc_attr($field->value); ?>"
<?php echo $field->get_html_attributes(); ?>
>
<select
class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>"
id="field-<?php echo esc_attr($field->id); ?>"
name="<?php echo esc_attr($field->id); ?>"
value="<?php echo esc_attr($field->value); ?>"
<?php echo $field->get_html_attributes(); ?>
>
<?php if ($field->placeholder) : ?>
<?php if ($field->placeholder) : ?>
<option <?php checked(!$field->value); ?> class="wu-opacity-75"><?php echo $field->placeholder; ?></option>
<option <?php checked(! $field->value); ?> class="wu-opacity-75"><?php echo $field->placeholder; ?></option>
<?php endif; ?>
<?php endif; ?>
<?php foreach ($field->options as $key => $label) : ?>
<?php foreach ($field->options as $key => $label) : ?>
<option
value="<?php echo esc_attr($key); ?>"
<?php checked($key, $field->value); ?>
>
<?php echo $label; ?>
</option>
<option
value="<?php echo esc_attr($key); ?>"
<?php checked($key, $field->value); ?>
>
<?php echo $label; ?>
</option>
<?php endforeach; ?>
<?php endforeach; ?>
<?php if ($field->options_template) : ?>
<?php if ($field->options_template) : ?>
<?php echo $field->options_template; ?>
<?php echo $field->options_template; ?>
<?php endif; ?>
<?php endif; ?>
</select>
</select>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,10 +7,10 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<button id="<?php echo esc_attr($field->id); ?>-btn" type="submit" name="<?php echo esc_attr($field->id); ?>-btn" <?php echo $field->get_html_attributes(); ?> class="button <?php echo esc_attr(trim($field->classes)); ?>">
<button id="<?php echo esc_attr($field->id); ?>-btn" type="submit" name="<?php echo esc_attr($field->id); ?>-btn" <?php echo $field->get_html_attributes(); ?> class="button <?php echo esc_attr(trim($field->classes)); ?>">
<?php echo $field->title; ?>
<?php echo $field->title; ?>
</button>
</button>
</div>

View File

@ -7,54 +7,62 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->prefix) : ?>
<?php if ($field->prefix) : ?>
<div class="sm:wu-flex wu-items-stretch wu-content-center">
<div class="sm:wu-flex wu-items-stretch wu-content-center">
<div <?php echo wu_array_to_html_attrs($field->prefix_html_attr ?? array()); ?>>
<?php echo $field->prefix; ?>
</div>
<div <?php echo wu_array_to_html_attrs($field->prefix_html_attr ?? array()); ?>>
<?php echo $field->prefix; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<input class="form-control wu-w-full wu-my-1 <?php echo esc_attr(trim($field->classes)); ?>" id="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" placeholder="<?php echo esc_attr($field->placeholder); ?>" value="<?php echo esc_attr($field->value); ?>" <?php echo $field->get_html_attributes(); ?>>
<?php if ($field->suffix) : ?>
<?php if ($field->suffix) : ?>
<div <?php echo wu_array_to_html_attrs($field->suffix_html_attr ?? array()); ?>>
<?php echo $field->suffix; ?>
</div>
<div <?php echo wu_array_to_html_attrs($field->suffix_html_attr ?? array()); ?>>
<?php echo $field->suffix; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($field->prefix || $field->suffix) : ?>
<?php if ($field->prefix || $field->suffix) : ?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,28 +7,32 @@
?>
<div class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<label class="wu-block wu-my-4" for="field-<?php echo esc_attr($field->id); ?>">
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<input id="field-<?php echo esc_attr($field->id); ?>" type="checkbox" name="<?php echo esc_attr($field->id); ?>" value="1" <?php echo $field->get_html_attributes(); ?> <?php checked($field->value); ?>>
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
</label>
</label>
<?php
<?php
/**
* Adds the partial error template.
* @since 2.0.0
*/
wu_get_template('checkout/fields/partials/field-errors', array(
'field' => $field,
));
/**
* Adds the partial error template.
*
* @since 2.0.0
*/
wu_get_template(
'checkout/fields/partials/field-errors',
array(
'field' => $field,
)
);
?>
?>
</div>

View File

@ -7,28 +7,28 @@
?>
<?php if ($form->wrap_in_form_tag) : ?>
<form id="<?php echo esc_attr($form_slug); ?>" method="<?php echo esc_attr($form->method); ?>" <?php echo $form->get_html_attributes(); ?>>
<form id="<?php echo esc_attr($form_slug); ?>" method="<?php echo esc_attr($form->method); ?>" <?php echo $form->get_html_attributes(); ?>>
<?php else : ?>
<<?php echo $form->wrap_tag; ?> class="<?php echo esc_attr(trim($form->classes ? $form->classes.' '.$step->classes.' wu-mt-2' : $step->classes.' wu-mt-2')); ?>" <?php echo $form->get_html_attributes(); ?>>
<<?php echo $form->wrap_tag; ?> class="<?php echo esc_attr(trim($form->classes ? $form->classes . ' ' . $step->classes . ' wu-mt-2' : $step->classes . ' wu-mt-2')); ?>" <?php echo $form->get_html_attributes(); ?>>
<?php endif; ?>
<?php if ($form->title) : ?>
<?php if ($form->title) : ?>
<h3 class="wu-checkout-section-title"><?php echo $form->title; ?></h3>
<h3 class="wu-checkout-section-title"><?php echo $form->title; ?></h3>
<?php endif; ?>
<?php endif; ?>
<?php echo $rendered_fields; ?>
<?php echo $rendered_fields; ?>
<?php if ($form->wrap_in_form_tag) : ?>
</form>
</form>
<?php else : ?>
</<?php echo $form->wrap_tag; ?>>
</<?php echo $form->wrap_tag; ?>>
<?php endif; ?>

View File

@ -8,6 +8,7 @@
<?php if ($field->desc) : ?>
<?php echo $field->desc; ?>
<?php echo $field->desc; ?>
<?php endif; ?>
<?php
endif;

View File

@ -7,8 +7,8 @@
?>
<span
v-cloak
class="wu-block wu-bg-red-100 wu-p-2 wu-mb-4"
v-if="get_error('<?php echo esc_attr($field->id); ?>')"
v-html="get_error('<?php echo esc_attr($field->id); ?>').message"
v-cloak
class="wu-block wu-bg-red-100 wu-p-2 wu-mb-4"
v-if="get_error('<?php echo esc_attr($field->id); ?>')"
v-html="get_error('<?php echo esc_attr($field->id); ?>').message"
></span>

View File

@ -8,18 +8,18 @@
<?php if ($field->title) : ?>
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>">
<label class="wu-block" for="field-<?php echo esc_attr($field->id); ?>">
<?php echo $field->title; ?>
<?php echo $field->title; ?>
<?php if ($field->required) : ?>
<?php if ($field->required) : ?>
<span class="wu-checkout-required-field wu-text-red-500">*</span>
<span class="wu-checkout-required-field wu-text-red-500">*</span>
<?php endif; ?>
<?php endif; ?>
<?php echo wu_tooltip($field->tooltip); ?>
<?php echo wu_tooltip($field->tooltip); ?>
</label>
</label>
<?php endif; ?>

View File

@ -10,7 +10,7 @@
id="wu_form"
method="post"
class="wu_checkout_form_<?php echo esc_attr($checkout_form_name); ?> wu-relative"
<?php echo isset($checkout_form_action) ? 'action="'.esc_attr($checkout_form_action).'"' : ''; ?>
<?php echo isset($checkout_form_action) ? 'action="' . esc_attr($checkout_form_action) . '"' : ''; ?>
>
<?php
@ -25,18 +25,22 @@
*
* @since 2.0.0
*/
$form = new \WP_Ultimo\UI\Form("checkout-{$step_name}", $final_fields, array(
'title' => $display_title ? $step['name'] : '',
'views' => 'checkout/fields',
'classes' => wu_get_isset($step, 'classes', '').' wu-grid wu-grid-cols-2 wu-gap-4',
'field_wrapper_classes' => 'wu-col-span-2',
'html_attr' => array(
'id' => wu_get_isset($step, 'element_id') ? wu_get_isset($step, 'element_id') : "wu-step-{$step_name}",
),
'variables' => array(
'step' => (object) $step,
),
));
$form = new \WP_Ultimo\UI\Form(
"checkout-{$step_name}",
$final_fields,
array(
'title' => $display_title ? $step['name'] : '',
'views' => 'checkout/fields',
'classes' => wu_get_isset($step, 'classes', '') . ' wu-grid wu-grid-cols-2 wu-gap-4',
'field_wrapper_classes' => 'wu-col-span-2',
'html_attr' => array(
'id' => wu_get_isset($step, 'element_id') ? wu_get_isset($step, 'element_id') : "wu-step-{$step_name}",
),
'variables' => array(
'step' => (object) $step,
),
)
);
/**
* Render form fields.

View File

@ -1,12 +1,12 @@
<?php
/**
* Template File: Basic Pricing Table.
*
*
* To see what methods are available on the product variable, @see inc/models/class-producs.php.
*
* This template can also be overrid using template overrides.
*
* This template can also be overrid 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.
@ -16,53 +16,53 @@
<?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">
<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'); ?>
<?php _e('No Products Found.', 'wp-ultimo'); ?>
</div>
</div>
<?php endif; ?>
<div class="wu-flex wu-mb-4 wu--mx-2">
<?php foreach ($products as $product) : ?>
<?php foreach ($products as $product) : ?>
<div
class="<?php echo "wu-product-{$product->get_id()}"; ?> wu-bg-gray-100 wu-m-2 wu-px-4 wu-py-4 wu-border wu-border-solid wu-rounded wu-border-gray-400 wu-box-border wu-flex-1 wu-flex wu-flex-col wu-justify-end"
>
<div
class="<?php echo "wu-product-{$product->get_id()}"; ?> wu-bg-gray-100 wu-m-2 wu-px-4 wu-py-4 wu-border wu-border-solid wu-rounded wu-border-gray-400 wu-box-border wu-flex-1 wu-flex wu-flex-col wu-justify-end"
>
<div class="wu-self-start">
<div class="wu-self-start">
<span class="wu-font-bold wu-block wu-text-xl"><?php echo $product->get_name(); ?></span>
<span class="wu-block wu-font-semibold"><?php echo $product->get_price_description(false); ?></span>
<span class="wu-font-bold wu-block wu-text-xl"><?php echo $product->get_name(); ?></span>
<span class="wu-block wu-font-semibold"><?php echo $product->get_price_description(false); ?></span>
</div>
</div>
<div class="wu-my-4">
<div class="wu-my-4">
<ul class="wu-m-0 wu-list-none">
<?php foreach ($product->get_pricing_table_lines() as $key => $line) : ?>
<ul class="wu-m-0 wu-list-none">
<?php foreach ($product->get_pricing_table_lines() as $key => $line) : ?>
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
<li class="<?php echo str_replace('_', '-', $key); ?>"><?php echo $line; ?></li>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
</ul>
</div>
</div>
<div class="wu-relative">
<div class="wu-relative">
<a href="#wu-checkout-add-<?php echo $product->get_slug(); ?>" class="button btn wu-w-full wu-text-center wu-inline-block">
<?php _e('Select', 'wp-ultimo'); ?>
</a>
<a href="#wu-checkout-add-<?php echo $product->get_slug(); ?>" class="button btn wu-w-full wu-text-center wu-inline-block">
<?php _e('Select', 'wp-ultimo'); ?>
</a>
</div>
</div>
<input type="checkbox" style="display: none;" name="products[]" value="<?php echo $product->get_slug(); ?>" v-model="products">
<input type="checkbox" style="display: none;" name="products[]" value="<?php echo $product->get_slug(); ?>" v-model="products">
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
</div>

View File

@ -10,72 +10,52 @@ $is_trial_setup = $membership->is_trialing() && empty($payment->get_total());
$notes = array();
if ($is_trial_setup) {
$desc = $membership->get_recurring_description();
$date = wp_date(get_option('date_format'), strtotime( $membership->get_date_trial_end(), wu_get_current_time('timestamp', true)));
$date = wp_date(get_option('date_format'), strtotime($membership->get_date_trial_end(), wu_get_current_time('timestamp', true)));
$notes[] = sprintf(__('Your trial period will end on %1$s.', 'wp-ultimo'), $date);
} // end if;
$original_cart = $payment->get_meta('wu_original_cart');
$should_auto_renew = !empty($original_cart) ? $original_cart->should_auto_renew() : false;
$should_auto_renew = ! empty($original_cart) ? $original_cart->should_auto_renew() : false;
$recurring_total = $membership->get_amount();
if ($membership->is_recurring() && $should_auto_renew) {
$payment_total = $payment->get_total() ? $payment->get_total() : $membership->get_initial_amount();
$desc = $membership->get_recurring_description();
if ($recurring_total !== $payment_total) {
$recurring_total_format = wu_format_currency($recurring_total, $payment->get_currency());
if ($original_cart->get_cart_type() === 'downgrade') {
$subtotal = wu_format_currency($payment->get_subtotal(), $payment->get_currency());
if ($is_trial_setup) {
$notes[] = sprintf(__('Your updated membership will start on $1$s, from that date you will be billed %2$s %3$s.', 'wp-ultimo'), $date, $subtotal, $desc);
} else {
$date_renew = wp_date(get_option('date_format'), strtotime( $membership->get_date_expiration(), wu_get_current_time('timestamp', true)));
$date_renew = wp_date(get_option('date_format'), strtotime($membership->get_date_expiration(), wu_get_current_time('timestamp', true)));
$notes[] = sprintf(__('Your updated membership will start on %1$s, from that date you will be billed %2$s %3$s.', 'wp-ultimo'), $date_renew, $subtotal, $desc);
} // end if;
} elseif ($is_trial_setup) {
$initial_amount_format = wu_format_currency($membership->get_initial_amount(), $payment->get_currency());
$notes[] = sprintf(__('After the first payment of %1$s you will be billed %2$s %3$s.', 'wp-ultimo'), $initial_amount_format, $recurring_total_format, $desc);
} else {
$notes[] = sprintf(__('After this payment you will be billed %1$s %2$s.', 'wp-ultimo'), $recurring_total_format, $desc);
} // end if;
} else {
$recurring_total_format = wu_format_currency($recurring_total, $payment->get_currency());
if ($is_trial_setup) {
$notes[] = sprintf(__('From that date, you will be billed %1$s %2$s.', 'wp-ultimo'), $recurring_total_format, $desc);
} else {
$notes[] = sprintf(__('After this payment you will be billed %1$s.', 'wp-ultimo'), $desc);
} // end if;
} // end if;
} // end if;
$note = implode(' ', $notes);
@ -90,7 +70,7 @@ $subtotal = 0;
<div class="wu-text-sm wu-mb-4 wu-rounded-lg wu-border wu-border-gray-300 wu-bg-white wu-border-solid wu-shadow-sm wu-px-6 wu-py-4">
<span class="wu-font-semibold wu-block wu-text-gray-900">
<?php echo sprintf('%s %s', wu_get_isset($checkout_details, 'FIRSTNAME', ''), wu_get_isset($checkout_details, 'LASTNAME', '')); ?>
<?php printf('%s %s', wu_get_isset($checkout_details, 'FIRSTNAME', ''), wu_get_isset($checkout_details, 'LASTNAME', '')); ?>
</span>
<div class="wu-text-gray-600">
@ -112,7 +92,7 @@ $subtotal = 0;
<tbody>
<?php
foreach ($payment->get_line_items() as $line_item) :
foreach ($payment->get_line_items() as $line_item) :
$subtotal += $line_item->get_subtotal();
?>
@ -152,7 +132,7 @@ $subtotal = 0;
</tfoot>
</table>
<?php if (!empty($note)) : ?>
<?php if ( ! empty($note)) : ?>
<div class="wu-col-span-2 wu-mb-4">
<div class="wu-p-4 wu-bg-yellow-200">

View File

@ -1,24 +1,28 @@
<form id="wu_form" method="post" class="wu-styling wu-relative">
<?php
<?php
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$order_form = new \WP_Ultimo\UI\Form('product-fields', $product_fields, array(
'title' => __('Products', 'wp-ultimo'),
'views' => 'checkout/fields',
));
/**
* Instantiate the form for the order details.
*
* @since 2.0.0
*/
$order_form = new \WP_Ultimo\UI\Form(
'product-fields',
$product_fields,
array(
'title' => __('Products', 'wp-ultimo'),
'views' => 'checkout/fields',
)
);
/**
* Render form fields.
*
* @see /view/checkout/fields/ for the template files for each field type.
* @since 2.0.0
*/
$order_form->render();
/**
* Render form fields.
*
* @see /view/checkout/fields/ for the template files for each field type.
* @since 2.0.0
*/
$order_form->render();
/**
* Instantiate the form for the submit button and such.

View File

@ -13,58 +13,59 @@ $product = wu_get_product($product['id']);
$product_variation = $product->get_as_variation($duration, $duration_unit);
if ($product_variation !== false) {
$product = $product_variation;
$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">
<div class="wu-flex wu-items-center">
<?php if ($display_product_image) : $image = $product->get_featured_image('thumbnail'); ?>
<?php
if ($display_product_image) :
$image = $product->get_featured_image('thumbnail');
?>
<?php if ($image) : ?>
<?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>
<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; ?>
<?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>
<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; ?>
<?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 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 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
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

@ -7,264 +7,265 @@
?>
<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">
<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'); ?>
<?php _e('Generating Order Summary...', 'wp-ultimo'); ?>
</div>
</div>
<div v-if="order" v-cloak>
<div v-if="order" v-cloak>
<table id="wu-order-summary-table" class="wu-w-full wu-mb-0">
<table id="wu-order-summary-table" class="wu-w-full wu-mb-0">
<thead>
<thead>
<tr class="">
<tr class="">
<th class="col-description">
<?php _e('Description', 'wp-ultimo'); ?>
</th>
<th class="col-description">
<?php _e('Description', 'wp-ultimo'); ?>
</th>
<?php if ($table_columns === 'simple') : ?>
<?php if ($table_columns === 'simple') : ?>
<th class="col-total-gross">
<?php _e('Subtotal', 'wp-ultimo'); ?>
</th>
<th class="col-total-gross">
<?php _e('Subtotal', 'wp-ultimo'); ?>
</th>
<?php else : ?>
<?php else : ?>
<th class="col-total-net">
<?php _e('Net Total', 'wp-ultimo'); ?>
</th>
<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-vat-percentage">
<?php _e('Discounts', 'wp-ultimo'); ?>
</th>
<th class="col-total-tax">
<?php _e('Tax', '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>
<th class="col-total-gross">
<?php _e('Gross Total', 'wp-ultimo'); ?>
</th>
<?php endif; ?>
<?php endif; ?>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr v-if="order.line_items.length === 0">
<tr v-if="order.line_items.length === 0">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 2 : 5; ?>" class="col-description">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 2 : 5; ?>" class="col-description">
<?php _e('No products in shopping cart.', 'wp-ultimo'); ?>
<?php _e('No products in shopping cart.', 'wp-ultimo'); ?>
</td>
</td>
</tr>
</tr>
<tr v-for="line_item in order.line_items">
<tr v-for="line_item in order.line_items">
<td class="wu-py-2 col-description" v-show="line_item.recurring">
<td class="wu-py-2 col-description" v-show="line_item.recurring">
<?php printf(__('Subscription - %s', 'wp-ultimo'), '{{ line_item.title }}'); ?>
<?php printf(__('Subscription - %s', 'wp-ultimo'), '{{ line_item.title }}'); ?>
<small v-if="line_item.type == 'product'" class="wu-ml-3 wu-text-xs">
<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)">
<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'); ?>
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</a>
</small>
</small>
</td>
</td>
<td class="wu-py-2 col-description" v-show="!line_item.recurring">
<td class="wu-py-2 col-description" v-show="!line_item.recurring">
{{ line_item.title }}
{{ line_item.title }}
<small v-if="line_item.type == 'product'" class="">
<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)">
<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'); ?>
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</a>
</small>
</small>
</td>
</td>
<?php if ($table_columns === 'simple') : ?>
<?php if ($table_columns === 'simple') : ?>
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
</td>
</td>
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }}
{{ wu_format_money(line_item.subtotal) }}
</td>
</td>
<?php else : ?>
<?php else : ?>
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
<td v-show="line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
{{ wu_format_money(line_item.subtotal) }} / {{ line_item.recurring_description }}
</td>
</td>
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
<td v-show="!line_item.recurring" class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.subtotal) }}
{{ wu_format_money(line_item.subtotal) }}
</td>
</td>
<td class="wu-py-2 col-total-net">
<td class="wu-py-2 col-total-net">
{{ wu_format_money(line_item.discount_total) }}
{{ wu_format_money(line_item.discount_total) }}
</td>
</td>
<td class="wu-py-2 col-total-tax">
<td class="wu-py-2 col-total-tax">
{{ wu_format_money(line_item.tax_total) }}
{{ wu_format_money(line_item.tax_total) }}
<small v-if="line_item.tax_rate" class="wu-block">
<small v-if="line_item.tax_rate" class="wu-block">
{{ line_item.tax_label }} {{ line_item.tax_rate }}%
{{ line_item.tax_label }} {{ line_item.tax_rate }}%
</small>
</small>
</td>
</td>
<td class="wu-py-2 col-total-gross">
<td class="wu-py-2 col-total-gross">
{{ wu_format_money(line_item.total) }}
{{ wu_format_money(line_item.total) }}
</td>
</td>
<?php endif; ?>
<?php endif; ?>
</tr>
</tr>
</tbody>
</tbody>
<tfoot class="">
<tfoot class="">
<?php if ($table_columns === 'simple') : ?>
<?php if ($table_columns === 'simple') : ?>
<tr>
<tr>
<td>
<td>
<?php _e("Discounts", 'wp-ultimo'); ?>
<?php _e('Discounts', 'wp-ultimo'); ?>
</td>
</td>
<td>
<td>
{{ wu_format_money(order.totals.total_discounts) }}
{{ wu_format_money(order.totals.total_discounts) }}
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>
<td>
<?php _e("Taxes", 'wp-ultimo'); ?>
<?php _e('Taxes', 'wp-ultimo'); ?>
</td>
</td>
<td>
<td>
{{ wu_format_money(order.totals.total_taxes) }}
{{ wu_format_money(order.totals.total_taxes) }}
</td>
</td>
</tr>
</tr>
<?php endif; ?>
<?php endif; ?>
<tr>
<tr>
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 1 : 4; ?>">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 1 : 4; ?>">
<strong><?php _e("Today's Grand Total", 'wp-ultimo'); ?></strong>
<strong><?php _e("Today's Grand Total", 'wp-ultimo'); ?></strong>
</td>
</td>
<td class="" v-show="order.has_trial">
<td class="" v-show="order.has_trial">
{{ wu_format_money(0) }}
{{ wu_format_money(0) }}
</td>
</td>
<td class="" v-show="!order.has_trial">
<td class="" v-show="!order.has_trial">
{{ wu_format_money(order.totals.total) }}
{{ wu_format_money(order.totals.total) }}
</td>
</td>
</tr>
</tr>
<tr v-if="order.has_trial">
<tr v-if="order.has_trial">
<td class="" colspan="<?php echo esc_attr($table_columns === 'simple') ? 1 : 4; ?>">
<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>
<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>
<td class="">
<td class="">
{{ wu_format_money(order.totals.total) }}
{{ wu_format_money(order.totals.total) }}
</td>
</td>
</tr>
</tr>
</tfoot>
</tfoot>
</table>
</table>
<ul class="wu-p-0 wu-m-0 wu-mt-2 wu-list-none wu-order-summary-additional-info wu-text-sm">
<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">
<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`) }}"); ?>
<?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>
<li class="order-description" v-if="order.totals.total_discounts < 0">
<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) }}'); ?>
<?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 = ''">
<a class="wu-no-underline wu-ml-2" href="#" v-on:click.prevent="discount_code = ''">
<?php _e('Remove', 'wp-ultimo'); ?>
<?php _e('Remove', 'wp-ultimo'); ?>
</a>
</a>
</li>
</li>
</ul>
</ul>
</div>
</div>
</div>

View File

@ -21,18 +21,18 @@ 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) : ?>
<?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>
<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; ?>
<?php endforeach; ?>
</ul>

View File

@ -22,18 +22,18 @@ defined('ABSPATH') || exit;
<div class="wu-mx-auto wu-text-center wu-mb-4">
<ul class="wu-plans-frequency-selector">
<ul class="wu-plans-frequency-selector">
<?php foreach ($period_options as $index => $period_option) : ?>
<?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>
<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; ?>
<?php endforeach; ?>
</ul>
</ul>
</div>

View File

@ -15,31 +15,34 @@
$products_to_reduce = array_merge(array(false), $products);
$first_recurring_product = array_reduce($products_to_reduce, function($chosen_product, $product) {
$first_recurring_product = array_reduce(
$products_to_reduce,
function ($chosen_product, $product) {
if ($product && $product->is_recurring() && $chosen_product == false) {
if ($product && $product->is_recurring() && $chosen_product == false) {
$chosen_product = $product;
} // end if;
$chosen_product = $product;
return $chosen_product;
}
);
} // end if;
$legacy_mode = array_reduce(
$products_to_reduce,
function ($all_have_same_duration, $product) use ($first_recurring_product) {
return $chosen_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;
}
);
$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('
wp_add_inline_script(
'wu-checkout',
sprintf(
'
/**
* Force different durations.
@ -48,11 +51,18 @@ wp_add_inline_script('wu-checkout', sprintf('
window.wu_legacy_mode = %s;
', json_encode($force_different_durations), json_encode($legacy_mode)), 'after');
',
json_encode($force_different_durations),
json_encode($legacy_mode)
),
'after'
);
if ($first_recurring_product !== null) {
wp_add_inline_script('wu-checkout', sprintf("
wp_add_inline_script(
'wu-checkout',
sprintf(
"
/**
* Add durations if necessary.
@ -78,8 +88,12 @@ if ($first_recurring_product !== null) {
});
", json_encode($first_recurring_product->get_duration()), json_encode($first_recurring_product->get_duration_unit())), 'after');
",
json_encode($first_recurring_product->get_duration()),
json_encode($first_recurring_product->get_duration_unit())
),
'after'
);
}
?>
@ -93,281 +107,267 @@ if ($first_recurring_product !== null) {
<?php else : ?>
<div class="wu-content-plan">
<div class="wu-content-plan">
<div class="layer plans wu-overflow-hidden wu-flex">
<div class="layer plans wu-overflow-hidden wu-flex">
<?php foreach ($products as $product) : ?>
<?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
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">
<div class="wu-relative">
<?php if ($product->is_featured_plan()) : ?>
<?php if ($product->is_featured_plan()) : ?>
<h6>
<h6>
<?php
<?php
/**
* Featured tag.
*/
echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-ultimo'), $product);
/**
* Featured tag.
*/
echo apply_filters('wu_featured_plan_label', __('Featured Plan', 'wp-ultimo'), $product);
?>
?>
</h6>
</h6>
<?php endif; ?>
<?php endif; ?>
<h4 class="wp-ui-primary">
<h4 class="wp-ui-primary">
<?php echo $product->get_name(); ?>
<?php echo $product->get_name(); ?>
</h4>
</h4>
<?php
<?php
/**
* Case Free
*/
if ($product->get_pricing_type() === 'free') :
/**
* Case Free
*/
if ($product->get_pricing_type() === 'free') :
?>
?>
<!-- Price -->
<h5>
<!-- Price -->
<h5>
<span class="plan-price">
<span class="plan-price">
<?php _e('Free!', 'wp-ultimo'); ?>
<?php _e('Free!', 'wp-ultimo'); ?>
</span>
</span>
</h5>
</h5>
<?php
<?php
/**
* Case Free
*/
elseif ($product->get_pricing_type() === 'contact_us') :
/**
* Case Free
*/
elseif ($product->get_pricing_type() === 'contact_us') :
?>
?>
<!-- Price -->
<h5>
<!-- Price -->
<h5>
<span class="plan-price">
<span class="plan-price">
<?php echo apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-ultimo')); ?>
<?php echo apply_filters('wu_plan_contact_us_price_line', __('--', 'wp-ultimo')); ?>
</span>
</span>
</h5>
</h5>
<?php else : ?>
<?php else : ?>
<!-- Price -->
<h5>
<!-- Price -->
<h5>
<?php
<?php
/**
* Price display.
*/
/**
* Price display.
*/
$symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), array('%s%v', '%s %v'));
$symbol_left = in_array(wu_get_setting('currency_position', '%s%v'), array('%s%v', '%s %v'));
?>
?>
<?php if ($symbol_left) : ?>
<?php if ($symbol_left) : ?>
<sup class="superscript">
<sup class="superscript">
<?php echo wu_get_currency_symbol($product->get_currency()); ?>
<?php echo wu_get_currency_symbol($product->get_currency()); ?>
</sup>
</sup>
<?php endif; ?>
<?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(); ?>')">
<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
<?php
$n = $product->get_amount();
$n = $product->get_amount();
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
?>
?>
</span>
</span>
<?php foreach (array(3, 12) as $freq) :
<?php
foreach (array(3, 12) as $freq) :
$price_variation = $product->get_price_variation($freq, 'month');
$price_variation = $product->get_price_variation($freq, 'month');
if ( ! $price_variation) {
continue;
} // end if;
if (!$price_variation) {
?>
continue;
<span class="plan-price" v-cloak v-if="duration == <?php echo $price_variation['duration']; ?> && duration_unit == '<?php echo $price_variation['duration_unit']; ?>'">
} // end if;
<?php
?>
$n = $price_variation ? $price_variation['monthly_amount'] : false;
<span class="plan-price" v-cloak v-if="duration == <?php echo $price_variation['duration']; ?> && duration_unit == '<?php echo $price_variation['duration_unit']; ?>'">
if ($n) {
echo str_replace(wu_get_currency_symbol(), '', wu_format_currency($n));
} else {
echo '--';
} // end if;
<?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>
</span>
<?php endforeach; ?>
</div>
</div>
<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

@ -9,63 +9,59 @@
* Deal with different pricing options
*/
foreach ($products as $index => &$_product) {
$_product = wu_get_product($_product['id']);
$_product = wu_get_product($_product['id']);
$product_variation = $_product->get_as_variation($duration, $duration_unit);
$product_variation = $_product->get_as_variation($duration, $duration_unit);
if ($product_variation === false && !$force_different_durations) {
unset($products[$index]);
$_product = $product_variation;
} // end if;
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; ?>">
<div class="wu-grid wu-grid-flow-row wu-gap-4 <?php echo $classes; ?>">
<?php foreach ($products as $product) : ?>
<?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">
<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-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">
<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-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>
<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; ?>
<?php endforeach; ?>
</div>
</div>
</div>

View File

@ -15,48 +15,45 @@
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
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">
<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) :
<?php
foreach ($steps as $index => $step) :
$step_key = $step['id'];
$step_key = $step['id'];
/**
* Class element of the Step Status Bar
*
* @var string
*/
$container_class = '';
$color = 'gray';
/**
* 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;
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>
<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>
</ul>
</nav>

View File

@ -15,42 +15,39 @@
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
if ( ! defined('ABSPATH')) {
exit; // Exit if accessed directly
}
?>
<ol class="wu-setup-steps wu-flex">
<?php foreach ($steps as $index => $step) :
<?php
foreach ($steps as $index => $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 === $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;
if ($step_key === $current_step) {
?>
$class = 'active';
<li class="<?php echo $class; ?> wu-flex-1">
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
<?php echo esc_html($step['name']); ?>
$class = 'done';
</li>
} // end if;
?>
<li class="<?php echo $class; ?> wu-flex-1">
<?php echo esc_html($step['name']); ?>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
</ol>

View File

@ -15,46 +15,43 @@
* @version 1.4.0
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
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">
<ul class="wu-minimal-steps">
<?php foreach ($steps as $index => $step) :
<?php
foreach ($steps as $index => $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 === $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;
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>
<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>
</ul>
</nav>

View File

@ -16,14 +16,13 @@
// Exit if accessed directly
defined('ABSPATH') || exit;
if (isset($should_display) && !$should_display) {
if (isset($should_display) && ! $should_display) {
?>
<div id="wu-site-template-container"></div>
<?php
return;
?>
<div id="wu-site-template-container"></div>
<?php
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
@ -38,110 +37,113 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
<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">
<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>
<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)) : ?>
<?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>
<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 endif; ?>
<?php if (isset($categories) && $categories) : ?>
<?php if (isset($categories) && $categories) : ?>
<?php foreach ($categories as $category) : ?>
<?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>
<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 endforeach; ?>
<?php endif; ?>
<?php endif; ?>
</ul>
</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">
<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 foreach ($sites as $site_template) : ?>
<?php if ($site_template->get_type() !== 'site_template' && !in_array($site_template->get_id(), $customer_sites, true)) { continue; } ?>
<?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 $is_template = $site_template->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site_template->get_categories(), !$is_template ? array($customer_sites_category) : array()); ?>
<?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
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">
<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()); ?>
>
<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(); ?>">
<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>
</a>
</div>
</div>
<h3 class="wu-site-template-title wu-text-lg wu-font-semibold">
<h3 class="wu-site-template-title wu-text-lg wu-font-semibold">
<?php echo $site_template->get_title(); ?>
<?php echo $site_template->get_title(); ?>
</h3>
</h3>
<p class="wu-site-template-description wu-text-sm">
<p class="wu-site-template-description wu-text-sm">
<?php echo $site_template->get_description(); ?>
<?php echo $site_template->get_description(); ?>
</p>
</p>
<div class="wu-mt-4">
<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">
<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-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>
<span v-else><?php _e('Select', 'wp-ultimo'); ?></span>
</button>
</button>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</div>

View File

@ -16,12 +16,10 @@
// Exit if accessed directly
defined('ABSPATH') || exit;
if (!$should_display) {
echo "<div></div>";
return;
if ( ! $should_display) {
echo '<div></div>';
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
@ -37,7 +35,7 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
<?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"
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'); ?>
@ -48,217 +46,219 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
<div class="themes-php wu-styling">
<div class="wrap wu-template-selection">
<div class="wrap wu-template-selection">
<?php
<?php
/**
* Allow developers to hide the title.
*/
if (apply_filters('wu_step_template_display_header', true)) :
/**
* Allow developers to hide the title.
*/
if (apply_filters('wu_step_template_display_header', true)) :
?>
<h2>
<h2>
<?php _e('Pick your Template', 'wp-ultimo'); ?>
<?php _e('Pick your Template', 'wp-ultimo'); ?>
<span class="title-count theme-count">
<span class="title-count theme-count">
<?php echo count($sites); ?>
<?php echo count($sites); ?>
</span>
</span>
</h2>
</h2>
<?php endif; ?>
<?php endif; ?>
<div class="wp-filter">
<div class="wp-filter">
<div class="wp-filter-responsive">
<div class="wp-filter-responsive">
<h4><?php _e('Template Categories', 'wp-ultimo'); ?></h4>
<h4><?php _e('Template Categories', 'wp-ultimo'); ?></h4>
<select class="">
<select class="">
<option value="">
<?php _e('All Templates', 'wp-ultimo'); ?>
</option>
<option value="">
<?php _e('All Templates', 'wp-ultimo'); ?>
</option>
<?php if (!empty($customer_sites)) : ?>
<?php if ( ! empty($customer_sites)) : ?>
<option value="<?php echo esc_attr($customer_sites_category); ?>">
<?php echo $customer_sites_category; ?>
</option>
<option value="<?php echo esc_attr($customer_sites_category); ?>">
<?php echo $customer_sites_category; ?>
</option>
<?php endif; ?>
<?php endif; ?>
<?php foreach ($categories as $category) : ?>
<?php foreach ($categories as $category) : ?>
<option value="<?php echo esc_attr($category); ?>">
<?php echo $category; ?>
</option>
<option value="<?php echo esc_attr($category); ?>">
<?php echo $category; ?>
</option>
<?php endforeach; ?>
<?php endforeach; ?>
</select>
</select>
</div>
</div>
<ul class="filter-links wp-filter-template">
<ul class="filter-links wp-filter-template">
<li class="selector-inactive">
<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>
<a
href="#"
data-category=""
:class="$parent.template_category === '' ? 'current' : ''"
v-on:click.prevent="$parent.template_category = ''"
>
<?php _e('All Templates', 'wp-ultimo'); ?>
</a>
</li>
</li>
<?php if (!empty($customer_sites)) : ?>
<?php if ( ! empty($customer_sites)) : ?>
<li class="selector-inactive">
<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>
<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>
</li>
<?php endif; ?>
<?php endif; ?>
<?php foreach ($categories as $category) : ?>
<?php foreach ($categories as $category) : ?>
<li class="selector-inactive">
<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>
<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>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
</ul>
</div>
</div>
<div class="theme-browser rendered">
<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">
<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 $i = 0; foreach ($sites as $site) : ?>
<?php if ($site->get_type() !== 'site_template' && !in_array($site->get_id(), $customer_sites, true)) { continue; } ?>
<?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 $is_template = $site->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site->get_categories(), !$is_template ? array($customer_sites_category) : array()) ?>
<?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"
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">
<div class="theme-screenshot">
<img
src="<?php echo $site->get_featured_image(); ?>"
alt="<?php echo $site->get_title(); ?>"
>
<img
src="<?php echo $site->get_featured_image(); ?>"
alt="<?php echo $site->get_title(); ?>"
>
</div>
</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"
>
<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'); ?>
<?php $is_template ? _e('View Template', 'wp-ultimo') : _e('View Site', 'wp-ultimo'); ?>
</a>
</a>
<div class="wu-flex theme-name-header wu-items-center wu-relative">
<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">
<h2 class="theme-name wu-flex-grow wu-h-full" id="<?php echo $site->get_id(); ?>-name">
<?php echo $site->get_title(); ?>
</h2>
<?php echo $site->get_title(); ?>
</h2>
<div class="theme-actions wu-flex">
<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()); ?>"
>
<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-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>
<span v-else><?php _e('Select', 'wp-ultimo'); ?></span>
</button>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
$i++;
endforeach;
?>
<?php
</div>
++$i;
endforeach;
</div>
?>
<div class="theme-overlay"></div>
</div>
<p class="no-themes">
</div>
<?php _e('No Templates Found', 'wp-ultimo'); ?>
</p>
<div class="theme-overlay"></div>
</div>
<p class="no-themes">
<?php _e('No Templates Found', 'wp-ultimo'); ?>
</p>
</div>
</div>

View File

@ -18,10 +18,8 @@
// Exit if accessed directly
defined('ABSPATH') || exit;
if (!$should_display) {
return;
if ( ! $should_display) {
return;
} // end if;
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
@ -35,107 +33,110 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
?>
<div id="wu-site-template-container">
<ul id="wu-site-template-filter">
<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>
<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)) : ?>
<?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>
<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 endif; ?>
<?php if (isset($categories) && $categories) : ?>
<?php if (isset($categories) && $categories) : ?>
<?php foreach ($categories as $category) : ?>
<?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>
<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 endforeach; ?>
<?php endif; ?>
<?php endif; ?>
</ul>
</ul>
<div id="wu-site-template-container-grid">
<div id="wu-site-template-container-grid">
<?php foreach ($sites as $site_template) : ?>
<?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
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 $is_template = $site_template->get_type() === 'site_template'; ?>
<?php $categories = array_merge($site_template->get_categories(), !$is_template ? array($customer_sites_category) : array()); ?>
<?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
>
<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(); ?>">
<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">
<h3 class="wu-site-template-title">
<?php echo $site_template->get_title(); ?>
<?php echo $site_template->get_title(); ?>
</h3>
</h3>
<p class="wu-site-template-description">
<p class="wu-site-template-description">
<?php echo $site_template->get_description(); ?>
<?php echo $site_template->get_description(); ?>
</p>
</p>
<div class="wu-site-template-preview-block">
<div class="wu-site-template-preview-block">
<a class="wu-site-template-selector" <?php echo $site_template->get_preview_url_attrs(); ?>>
<a class="wu-site-template-selector" <?php echo $site_template->get_preview_url_attrs(); ?>>
<?php _e('View Template Preview', 'wp-ultimo'); ?>
<?php _e('View Template Preview', 'wp-ultimo'); ?>
</a>
</a>
</div>
</div>
<label for="wu-site-template-id-<?php echo esc_attr($site_template->get_id()); ?>">
<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()); ?>" />
<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="#">
<a class="wu-site-template-selector" @click.prevent="" href="#">
<?php _e('Select this Template', 'wp-ultimo'); ?>
<?php _e('Select this Template', 'wp-ultimo'); ?>
</a>
</a>
</label>
</label>
</div>
</div>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</div>