Ejemplo n.º 1
0
 /**
  * Gets plan price
  *
  * @access public
  * @param int $ID
  * @return string
  */
 public static function getPlanPrice($ID)
 {
     $out = '';
     if (ThemexWoo::isActive()) {
         $product = ThemexCore::getPostRelations($ID, 0, 'plan_product', true);
         $period = intval(ThemexCore::getPostMeta($ID, 'plan_period', 7));
         $converted = themex_time($period * 86400, true);
         if ($product != 0) {
             $price = ThemexWoo::getPrice($product);
             $out = '<span>' . $price['text'] . '</span>';
             if ($period != 0 && strpos($price['type'], 'subscription') === false) {
                 $out .= ' / ' . $converted;
             }
         }
     }
     return $out;
 }
Ejemplo n.º 2
0
<aside class="fivecol column last">
	<?php 
$courses = ThemexCourse::getCourses(ThemexUser::$data['active_user']['ID']);
$plan = ThemexCourse::getPlan(ThemexUser::$data['active_user']['ID']);
if (ThemexUser::isProfile() && !empty($plan)) {
    ?>
	<h2 class="secondary">
		<?php 
    if ($plan['period'] == 0) {
        printf(__('"%s" subscription is active.', 'academy'), '<a href="' . $plan['url'] . '">' . get_the_title($plan['ID']) . '</a>');
    } else {
        printf(__('"%s" subscription expires in %s.', 'academy'), '<a href="' . $plan['url'] . '">' . get_the_title($plan['ID']) . '</a>', themex_time($plan['time']));
    }
    ?>
	</h2>
	<?php 
}
?>
	<?php 
if (empty($courses)) {
    ?>
	<h2 class="secondary"><?php 
    _e('No courses yet.', 'academy');
    ?>
</h2>
	<?php 
} else {
    ?>
	<div class="user-courses-listing">
	<?php 
    foreach ($courses as $ID) {