<div class="widget sidebar-widget">
	<div class="widget-title">
		<h4><?php 
_e('Owner', 'makery');
?>
</h4>
	</div>
	<div class="widget-content">
		<?php 
$author = ThemexUser::getUser(ThemexShop::$data['author'], true);
?>
		<div class="shop-author small clearfix">
			<div class="author-image">
				<div class="image-wrap">
					<a href="<?php 
echo esc_url($author['links']['profile']['url']);
?>
">
						<?php 
echo get_avatar($author['ID'], 150);
?>
	
					</a>
				</div>
			</div>
			<div class="author-details">
				<h4 class="author-name">
					<a href="<?php 
echo esc_url($author['links']['profile']['url']);
?>
">
Example #2
0
        ?>
</th>
					<td>
						<?php 
        echo $order['condition'];
        ?>
					</td>
				</tr>
				<tr>
					<th><?php 
        _e('Customer', 'makery');
        ?>
</th>
					<td>
						<?php 
        $customer = ThemexUser::getUser($order['customer'], true);
        ?>
						<a href="<?php 
        echo esc_url($customer['links']['profile']['url']);
        ?>
"><?php 
        echo $customer['profile']['full_name'];
        ?>
</a>
					</td>
				</tr>				
			</tbody>
		</table>
		<table class="profile-table shop_table order_details">
			<thead>
				<tr>
<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) {
Example #4
0
<?php

ThemexUser::refresh($GLOBALS['user']->ID);
?>
<div class="expert-preview">
	<div class="expert-meta">
		<div class="expert-image bordered-image">
			<a href="<?php 
echo ThemexUser::$data['active_user']['profile_url'];
?>
"><?php 
echo get_avatar(ThemexUser::$data['active_user']['ID']);
?>
</a>
		</div>
		<?php 
get_template_part('module', 'links');
?>
	</div>
	<div class="expert-text">
		<h4 class="nomargin">
			<a href="<?php 
echo ThemexUser::$data['active_user']['profile_url'];
?>
">
			<?php 
echo ThemexUser::$data['active_user']['profile']['full_name'];
?>
			</a>
		</h4>
		<span class="expert-signature"><?php 
Example #5
0
<?php

ThemexShop::refresh($post->ID);
$owner = ThemexUser::getUser(ThemexShop::$data['author']);
?>
<div class="shop-preview">
	<div class="shop-images clearfix">
		<?php 
for ($index = 0; $index < 4; $index++) {
    ?>
		<div class="item-image">
			<div class="image-wrap">
				<?php 
    if (isset(ThemexShop::$data['products'][$index])) {
        ?>
				<a href="<?php 
        echo get_permalink(ThemexShop::$data['products'][$index]);
        ?>
" title="<?php 
        echo get_the_title(ThemexShop::$data['products'][$index]);
        ?>
">
					<?php 
        echo ThemexCore::getImage(ThemexShop::$data['products'][$index], 200, THEME_URI . 'images/product.png');
        ?>
				</a>
				<?php 
    } else {
        ?>
				<a href="<?php 
        the_permalink();
Example #6
0
<div class="widget">
	<div class="widget-title">
		<h4 class="nomargin left"><?php 
_e('Students', 'academy');
?>
</h4>
	</div>
	<div class="widget-content clearfix">
		<div class="users-listing clearfix">
			<?php 
$counter = 0;
foreach (ThemexCourse::getMembers() as $ID) {
    ThemexUser::refresh($ID);
    if (!empty(ThemexUser::$data['active_user'])) {
        $counter++;
        ?>
					<div class="user-image <?php 
        echo $counter == 3 ? 'last' : '';
        ?>
">
						<div class="bordered-image">
							<a title="<?php 
        echo ThemexUser::$data['active_user']['profile']['full_name'];
        ?>
" href="<?php 
        echo ThemexUser::$data['active_user']['profile_url'];
        ?>
"><?php 
        echo get_avatar($ID, 100);
        ?>
</a>
            ?>
">
							<span class="fa fa-upload"></span>
						</label>
						<input type="file" id="product_thumb" name="product_image" class="element-upload shifted" />
						<input type="hidden" name="product_id" value="<?php 
            echo ThemexWoo::$data['product']['ID'];
            ?>
" />
						<input type="hidden" name="woo_action" value="update_image" />
					</form>
				</div>
				<?php 
        }
    } else {
        if (ThemexUser::isShop()) {
            ThemexShop::refresh(ThemexUser::$data['current']['shop'], true);
            ?>
			<div class="image-wrap">
				<?php 
            echo ThemexCore::getImage(themex_value('ID', ThemexShop::$data), 200, THEME_URI . 'images/shop.png');
            ?>
			</div>
			<div class="profile-upload">
				<form action="" enctype="multipart/form-data" method="POST">
					<label for="shop_thumb" class="element-button square" title="<?php 
            _e('Upload Image', 'makery');
            ?>
">
						<span class="fa fa-upload"></span>
					</label>
 /**
  * Updates shop rating
  *
  * @access public
  * @param int $ID
  * @return void
  */
 public static function updateRating($ID)
 {
     $rating = get_comment_meta($ID, 'rating', true);
     if (!empty($rating)) {
         $comment = get_comment($ID);
         $user = get_post_field('post_author', $comment->comment_post_ID);
         $shop = ThemexUser::getShop($user);
         $rating = ThemexWoo::getRating($user);
         ThemexCore::updatePostMeta($shop, 'rating', $rating['rating']);
         ThemexCore::updatePostMeta($shop, 'ratings', $rating['ratings']);
     }
 }
Example #9
0
 /**
  * Updates shipping rates
  *
  * @access public
  * @param array $rates
  * @param array $package
  * @return array
  */
 public static function updateShipping($rates, $package)
 {
     $products = $package['contents'];
     $product = reset($products);
     $total = $package['contents_cost'];
     $shipping = ThemexShop::getShipping(ThemexUser::getShop($product['data']->post->post_author));
     $country = '';
     if (isset($package['destination']) && isset($package['destination']['country'])) {
         $country = $package['destination']['country'];
     }
     if (!empty($rates)) {
         foreach ($rates as $key => $rate) {
             if (isset($shipping[$key])) {
                 $method = $shipping[$key];
                 $enabled = themex_value('enabled', $method);
                 $available = themex_value('availability', $method);
                 $amount = themex_value('min_amount', $method);
                 $countries = themex_array('countries', $method);
                 if ($enabled == 'no' || !empty($amount) && $total < $amount || $available == 'specific' && !in_array($country, $countries)) {
                     unset($rates[$key]);
                 } else {
                     if ($key == 'flat_rate') {
                         $default = intval(themex_value('default_cost', $method));
                         $costs = themex_array('costs', $method);
                         $cost = 0;
                         foreach ($products as $product) {
                             $classes = get_the_terms($product['product_id'], 'product_shipping_class');
                             if (is_array($classes) && !empty($classes)) {
                                 $class = reset($classes);
                                 $class = $class->slug;
                                 if (isset($costs[$class])) {
                                     $cost = $cost + intval($costs[$class]) * $product['quantity'];
                                 } else {
                                     $cost = $cost + $default * $product['quantity'];
                                 }
                             } else {
                                 $cost = $cost + $default * $product['quantity'];
                             }
                         }
                         $rates[$key]->cost = $cost;
                     }
                 }
             }
         }
     }
     return $rates;
 }
	</table>
	<?php 
    $query = new WP_Query(array('post_type' => 'membership', 'showposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'));
    if ($query->have_posts()) {
        ?>
	<div class="shop-membership element-toggle">
		<?php 
        while ($query->have_posts()) {
            $query->the_post();
            ?>
		<div class="toggle-container">
			<div class="toggle-title"><h4><?php 
            the_title();
            ?>
<span class="right"><?php 
            echo ThemexUser::getPeriod($post->ID);
            ?>
</span></h4></div>
			<div class="toggle-content">
				<?php 
            the_content();
            ?>
				<form action="" method="POST">
					<a href="#" class="element-button element-submit primary"><?php 
            _e('Subscribe', 'makery');
            ?>
</a>
					<input type="hidden" name="membership_id" value="<?php 
            echo $post->ID;
            ?>
" />
Example #11
0
</div>
		<?php 
    if (ThemexForm::isActive('profile')) {
        ?>
		<table class="user-fields">
			<?php 
        ThemexForm::renderData('profile', array('edit' => false, 'before_title' => '<tr><th>', 'after_title' => '</th>', 'before_content' => '<td>', 'after_content' => '</td></tr>'), ThemexUser::$data['active_user']['profile']);
        ?>
		</table>
		<?php 
    }
    ?>
		<?php 
    echo ThemexUser::$data['active_user']['profile']['description'];
    ?>
	</div>
	<?php 
}
?>
	<?php 
if (!ThemexCore::checkOption('profile_courses') || ThemexUser::isProfile()) {
    ?>
	<?php 
    get_sidebar('profile-right');
    ?>
	<?php 
}
?>
</div>
<?php 
get_footer();
Example #12
0
<?php

if (ThemexUser::isProfile()) {
    get_template_part('template', 'profile');
} else {
    get_header();
    get_sidebar('profile-left');
    ?>
<div class="column fivecol">
	<div class="element-title clearfix">
		<h1><?php 
    echo ThemexUser::$data['active']['profile']['full_name'];
    ?>
</h1>
	</div>
	<div class="profile-content">
		<?php 
    echo wpautop(ThemexUser::$data['active']['profile']['description']);
    ?>
	</div>
	<div class="profile-options clearfix">
		<?php 
    if (!empty(ThemexUser::$data['active']['settings']['notices'])) {
        ?>
			<?php 
        if (is_user_logged_in()) {
            ?>
			<a href="#contact_form" class="element-button element-colorbox"><?php 
            _e('Contact', 'makery');
            ?>
</a>
<aside class="column fourcol last">	
	<?php 
ThemexShop::refresh(ThemexUser::$data['active']['shop'], true);
if (!ThemexCore::checkOption('shop_multiple') && ThemexShop::$data['status'] == 'publish') {
    get_template_part('module', 'shop');
}
if (!empty(ThemexShop::$data['reviews'])) {
    get_template_part('module', 'reviews');
}
if (!ThemexCore::checkOption('product_favorites')) {
    get_template_part('module', 'favorites');
}
if (ThemexUser::isProfile() && !ThemexCore::checkOption('shop_favorites')) {
    get_template_part('module', 'updates');
}
if (!ThemexCore::checkOption('shop_multiple') && ThemexShop::$data['status'] != 'publish') {
    get_template_part('module', 'shop');
}
ThemexSidebar::renderSidebar('profile');
?>
</aside>
				</div>
			</div>
		</div>
	</div>
	<div class="column eightcol last">
		<div class="element-title">
			<h1 itemprop="name" class="product_title entry-title"><a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_title();
    ?>
</a></h1>
			<?php 
    woocommerce_template_single_rating();
    ?>
		</div>
		<?php 
    if (ThemexUser::isMember($post->post_author)) {
        woocommerce_template_single_add_to_cart();
    }
    ?>
		<div class="item-details">
			<?php 
    the_excerpt();
    ?>
		</div>
	</div>
</div>
<?php 
}
Example #15
0
 /**
  * Gets course author
  *
  * @access public	
  * @param int $ID
  * @return array
  */
 public static function getAuthor($ID)
 {
     global $wpdb;
     $results = $wpdb->get_results("\r\n\t\t\tSELECT post_author FROM " . $wpdb->posts . " \r\n\t\t\tWHERE ID = " . intval($ID) . "\r\n\t\t");
     $results = wp_list_pluck($results, 'post_author');
     $user = intval(reset($results));
     $author = ThemexUser::getUser($user);
     return $author;
 }
Example #16
0
wp_nonce_field('woocommerce-cart');
?>
						</td>
					</tr>
					<?php 
do_action('woocommerce_after_cart_contents');
?>
				</tbody>
			</table>
			<?php 
do_action('woocommerce_after_cart_table');
?>
		</form>
		<?php 
foreach ($cart as $author => $products) {
    $title = get_the_title(ThemexUser::getShop($author));
    ?>
		<div class="element-title indented">
			<h2><?php 
    echo __('Order from', 'woocommerce') . ' ' . $title;
    ?>
</h2>
		</div>
		<form action="<?php 
    echo esc_url(WC()->cart->get_cart_url());
    ?>
" method="POST">
			<table class="shop_table cart" cellspacing="0">
				<thead>
					<tr>					
						<th class="product-thumbnail">&nbsp;</th>
							</div>
						</li>
						<?php 
    }
    ?>
					</ul>
				</div>							
			</div>
		</div>
		<?php 
    if ($show) {
        echo ob_get_clean();
    } else {
        ob_end_clean();
    }
    $shop = ThemexUser::getShop($post->post_author);
    if (!empty($shop)) {
        ThemexShop::refresh($shop);
        get_template_part('module', 'shop');
    }
    ThemexSidebar::renderSidebar('product');
    ?>
	</aside>
	<div class="item-full column eightcol last">
		<?php 
    do_action('woocommerce_single_product_summary');
    ?>
	</div>
	<div class="clear"></div>
	<?php 
    do_action('woocommerce_after_single_product_summary');
Example #18
0
<?php

ThemexUser::$data['active'] = ThemexUser::getUser($GLOBALS['user']->ID, true);
?>
<div class="image-border small">
	<div class="image-wrap">
		<a href="<?php 
echo ThemexUser::$data['active']['links']['profile']['url'];
?>
" title="<?php 
echo ThemexUser::$data['active']['profile']['full_name'];
?>
">
			<?php 
echo get_avatar(ThemexUser::$data['active']['ID'], 200);
?>
		</a>
	</div>
</div>