*/ get_header(); get_sidebar('profile-left'); ?> <div class="column fivecol"> <div class="element-title indented"> <h1><?php _e('My Address', 'makery'); ?> </h1> </div> <?php ThemexInterface::renderTemplateContent('profile-address'); ?> <?php if (!ThemexWoo::isActive() || ThemexCore::checkOption('profile_address')) { ?> <span class="secondary"><?php _e('There are no fields in this form.', 'makery'); ?> </span> <?php } else { ?> <form action="" method="POST" class="site-form"> <div class="message"> <?php ThemexInterface::renderMessages(themex_value('success', $_POST, false)); ?> </div> <table class="profile-fields">
/** * 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; }
/** * Gets user * * @access public * @param int $ID * @param bool $extended * @return array */ public static function getUser($ID, $extended = false) { $data = get_userdata($ID); if ($data != false) { $user['login'] = $data->user_login; $user['email'] = $data->user_email; $user['date'] = $data->user_registered; } $user['ID'] = $ID; $user['profile'] = self::getProfile($ID); $user['settings'] = self::getSettings($ID); $user['shop'] = self::getShop($ID); $user['favorites'] = array_reverse(ThemexCore::getUserRelations($ID, 0, 'product')); $user['shops'] = ThemexCore::getUserRelations($ID, 0, 'shop'); $user['updates'] = ThemexWoo::getRelations($user['shops']); $user['clicks'] = intval(ThemexCore::getUserMeta($ID, 'clicks')); $user['profit'] = round(floatval(ThemexCore::getUserMeta($ID, 'profit')), 2); $user['balance'] = round(floatval(ThemexCore::getUserMeta($ID, 'balance')), 2); if ($extended) { $user['links'] = self::getLinks($ID, array('shops' => !ThemexCore::checkOption('shop_multiple'), 'shop' => themex_status($user['shop']) == 'publish', 'referrals' => !ThemexCore::checkOption('shop_referrals'), 'woocommerce' => ThemexWoo::isActive(), 'address' => !ThemexCore::checkOption('profile_address'), 'links' => !ThemexCore::checkOption('profile_links'), 'shipping' => !ThemexCore::checkOption('shop_shipping') && ThemexWoo::isShipping())); } return $user; }
<!-- /header --> <div class="site-toolbar container"> <nav class="header-menu element-menu left"> <?php wp_nav_menu(array('theme_location' => 'main_menu', 'container_class' => 'menu')); ?> </nav> <div class="select-menu element-select redirect medium"> <span></span> <?php ThemexInterface::renderDropdownMenu('main_menu'); ?> </div> <!-- /menu --> <?php if (ThemexWoo::isActive()) { ?> <div class="header-cart right"> <a href="<?php echo ThemexWoo::$woocommerce->cart->get_cart_url(); ?> " class="cart-amount"> <span class="fa fa-shopping-cart"></span> <?php echo ThemexWoo::$woocommerce->cart->get_cart_total(); ?> </a> <div class="cart-quantity"><?php echo ThemexWoo::$woocommerce->cart->cart_contents_count; ?> </div>
/** * Renders shop options * * @access public * @param int $ID * @return string */ public static function renderShop($ID) { $out = ''; $shop = self::getShop($ID, true); $profit = round(floatval(ThemexCore::getUserMeta($shop['author'], 'profit')), 2); $balance = round(floatval(ThemexCore::getUserMeta($shop['author'], 'balance')), 2); $nickname = get_user_meta($shop['author'], 'nickname', true); $fields['author'] = array('label' => __('Author', 'makery'), 'value' => '<a href="' . get_edit_user_link($shop['author']) . '">' . $nickname . '</a>'); if (ThemexWoo::isActive()) { $products = count($shop['products']); $fields['products'] = array('label' => __('Products', 'makery'), 'value' => '<a href="' . admin_url('edit.php?post_type=product&author=' . $shop['author']) . '">' . $products . '</a>'); $orders = count($shop['orders']); $fields['orders'] = array('label' => __('Orders', 'makery'), 'value' => '<a href="' . admin_url('edit.php?post_type=shop_order&author=' . $shop['author']) . '">' . $orders . '</a>'); } $fields['revenue'] = array('label' => __('Total Revenue', 'makery'), 'value' => ThemexWoo::getPrice($shop['revenue'])); $fields['profit'] = array('label' => __('Total Profit', 'makery'), 'value' => ThemexWoo::getPrice($profit)); $fields['balance'] = array('label' => __('Current Balance', 'makery'), 'value' => ThemexWoo::getPrice($balance)); $fields['rate'] = array('label' => __('Current Rate', 'makery'), 'value' => $shop['rate'] . '%'); foreach ($fields as $field) { $out .= '<tr><th><h4 class="themex-meta-title">' . $field['label'] . '</h4></th><td class="themex-meta-value">' . $field['value'] . '</td></tr>'; } return $out; }
/** * Adds user membership * * @access public * @param int $ID * @param int $membership * @param bool $checkout * @return void */ public static function addMembership($ID, $membership, $checkout = true) { $membership = intval($membership); if ($checkout && ThemexWoo::isActive()) { $product = intval(ThemexCore::getPostMeta($membership, 'product')); if ($product != 0) { ThemexWoo::checkoutProduct($product); } } else { if ($membership == 0) { $period = 0; } else { $period = absint(ThemexCore::getPostMeta($membership, 'period')); } $date = $period * 86400 + current_time('timestamp'); if ($period == 0) { $date = 0; } ThemexCore::updateUserMeta($ID, 'membership', strval($membership)); ThemexCore::updateUserMeta($ID, 'membership_date', strval($date)); } self::countMembership($ID); }
*/ get_header(); get_sidebar('profile-left'); ?> <div class="column fivecol"> <div class="element-title indented"> <h1><?php _e('Shop Membership', 'makery'); ?> </h1> </div> <?php ThemexInterface::renderTemplateContent('shop-membership'); ?> <?php if (!ThemexWoo::isActive() || !ThemexCore::checkOption('membership_free')) { ?> <span class="secondary"><?php _e('This shop does not exist.', 'makery'); ?> </span> <?php } else { $membership = ThemexUser::getMembership(ThemexUser::$data['current']['ID']); ?> <table class="profile-fields"> <tbody> <tr> <th><?php _e('Membership', 'makery'); ?>
*/ get_header(); get_sidebar('profile-left'); ?> <div class="column fivecol"> <div class="element-title indented"> <h1><?php _e('Shop Shipping', 'makery'); ?> </h1> </div> <?php ThemexInterface::renderTemplateContent('shop-shipping'); ?> <?php if (!ThemexWoo::isActive() || ThemexCore::checkOption('shop_shipping')) { ?> <span class="secondary"><?php _e('This shop does not exist.', 'makery'); ?> </span> <?php } else { $methods = ThemexWoo::getShippingMethods(); $shipping = ThemexShop::getShipping(ThemexShop::$data['ID']); if (!empty($methods)) { ?> <form action="" method="POST" class="site-form"> <div class="message"> <?php ThemexInterface::renderMessages(themex_value('success', $_POST, false));
*/ get_header(); get_sidebar('profile-left'); ?> <div class="column fivecol"> <div class="element-title indented"> <h1><?php _e('My Referrals', 'makery'); ?> </h1> </div> <?php ThemexInterface::renderTemplateContent('profile-referrals'); ?> <?php if (ThemexCore::checkOption('shop_referrals') || !ThemexWoo::isActive()) { ?> <span class="secondary"><?php _e('This page does not exist.', 'makery'); ?> </span> <?php } else { ?> <form action="" method="POST" class="site-form"> <table class="profile-fields"> <tbody> <tr> <th><?php _e('Referral Link', 'makery'); ?>