/** * Remove key and login from querystring, set cookie, and redirect to account page to show the form. */ public static function redirect_reset_password_link() { if (is_account_page() && !empty($_GET['key']) && !empty($_GET['login'])) { $value = sprintf('%s:%s', wp_unslash($_GET['login']), wp_unslash($_GET['key'])); WC_Shortcode_My_Account::set_reset_password_cookie($value); wp_safe_redirect(add_query_arg('show-reset-form', 'true', wc_lostpassword_url())); exit; } }
_e('Remember me', 'woocommerce'); ?> </label> </fieldset> <input type="hidden" name="redirect_to" id="redirect_to" value="<?php bloginfo('url'); ?> /my-account/" /> <?php wp_nonce_field('ajax-login-nonce', 'security'); ?> <p class="status"></p> <a href="<?php echo esc_url(wc_lostpassword_url()); ?> " class="forgot-password"><?php _e('Lost your password?', 'woocommerce'); ?> </a> <?php do_action('woocommerce_login_form_end'); ?> </form> </div> <div class="col"> <h1><?php _e('Create an account', 'woocommerce'); ?>
function displayForm($atts) { $user_status = is_user_logged_in(); if (!$user_status && !isset($_GET['action'])) { ?> <div id="WK_ContentLoginForm"> <?php wc_print_notices(); ?> <form method="post" class="login"> <fieldset class="[ margin-bottom ]"> <label for="username"><?php _e('Username or email address', 'marketplace'); ?> <span class="required">*</span></label> <input type="text" class="[ input-text ][ xmall-12 ]" name="wkmp_username" id="username" value="<?php echo isset($_GET['email']) ? $_GET['email'] : ''; ?> " placeholder="enter your email id or username"/> </fieldset> <fieldset class="[ margin-bottom ]"> <label for="password"><?php _e('Password', 'marketplace'); ?> <span class="required">*</span></label> <input class="[ input-text ][ xmall-12 ]" type="password" name="password" id="password" value="" placeholder="enter your password" /> </fieldset> <fieldset> <input type="hidden" value="<?php echo wp_get_referer(); ?> " name="_wp_http_referer1"> </fieldset> <fieldset class="[ margin-bottom ]"> <label for="rememberme"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e('Remember me', 'marketplace'); ?> </label> </fieldset> <fieldset class="[ text-center ][ margin-bottom "> <?php wp_nonce_field('marketplace-username'); ?> <input type="submit" class="[ button button--primary ]" name="login" value="<?php _e('Login', 'marketplace'); ?> " /> <a href="<?php echo wp_registration_url(); ?> "><input type="button" class="[ button button--primary ]" value="<?php _e("Register"); ?> "></a> </fieldset> <fieldset class="[ text-center ]"> <a href="<?php echo esc_url(wc_lostpassword_url()); ?> "><?php _e('Lost your password?', 'marketplace'); ?> </a> </fieldset> </form> </div> <!-- content div --> <?php } else { if ($user_status) { global $wpdb; $wpmp_obj1 = new MP_Form_Handler(); $current_user = wp_get_current_user(); // MP_Form_Handler::profile_edit_redirection(); $wpmp_obj1->profile_edit_redirection(); // $avatar=MP_Form_Handler::get_user_avatar($current_user->ID,'avatar'); $avatar = $wpmp_obj1->get_user_avatar($current_user->ID, 'avatar'); // $seller_detail=MP_Form_Handler::seller_details($current_user->ID); $seller_detail = $wpmp_obj1->seller_details($current_user->ID); $seller_info = $wpdb->get_var("SELECT user_id FROM {$wpdb->prefix}mpsellerinfo WHERE user_id = '" . $current_user->data->ID . "' and seller_value=1"); echo '<h3 class="[ text-center ]"><small>Profile</small></h3>'; echo '<div class="wk_profileclass">'; echo '<form method="post">'; if ($current_user->data->ID && $seller_info > 0) { if (isset($avatar[0]->meta_value)) { echo '<div class="wk_profileimg"><img src="' . content_url() . '/uploads/' . $avatar[0]->meta_value . '" /></div>'; } else { echo '<div class="wk_profileimg"><img src="' . content_url() . '/plugins/marketplace/assets/images/genric-male.png" /></div>'; } } echo '<div class="wk_profileinfo"><div class="wk_profiledata"><label>Username </label> : ' . $current_user->user_login . '</div>'; echo '<div class="wk_profiledata"><label>E-mail </label> : ' . $current_user->user_email . '</div>'; echo '<div class="wk_profiledata"><label>Name </label> : ' . $current_user->user_firstname . ' ' . $current_user->user_lastname . '</div>'; echo '<div class="wk_profiledata"><label>Display name </label> : ' . $current_user->display_name . '</div>'; if ($current_user->data->ID && $seller_info > 0) { echo '<div class="wk_profiledata"><label>Shop Name </label> : ' . $seller_detail['shop_name'][0] . '</div>'; echo '<div class="wk_profiledata"><label>Address </label> : ' . $seller_detail['shop_address'][0] . '</div>'; if (strchr(get_permalink(), '?')) { $icon = '&'; } else { $icon = '?'; } echo '<div class="wk_profile_btn"><a href="' . get_permalink() . $icon . 'page=pedit" title="Edit Profile" class="[ button button--highlight ]">Edit</a></div>'; } //echo '<a href="'.wp_logout_url().'" title="Logout" class="button">Logout</a><br /></div>'; echo '</form></div> </div>'; } else { if (isset($_GET['action']) && !$user_status && $_GET['action'] == 'mp_register') { ?> <div id="WK_ContentRegisterForm"> <?php wc_print_notices(); ?> <h3 class="[ text-center ][ margin-bottom ]"><small>Registrate</h3></small> <form action="<?php echo get_permalink(); ?> " method="post" id="registration_form"> <div class="[ wk_login_input ][ ]"> <label for="wk_username"><?php _e("Username"); ?> </label><span class="required">*</span> <input type="text" name="wk_username" placeholder="" id="wk_username" class="[ wk_loginput ][ xmall-12 ]"/> <div class="error-class" id="seller_user_name"></div> </div> <div class="[ wk_login_input ][ ]"> <label for="wk_firstname">Nombre</label><span class="required">*</span> <input type="text" placeholder="" name="wk_firstname" id="wk_firstname" class="[ wk_loginput ][ xmall-12 ]"/> <div class="error-class" id="seller_first_name"></div> </div> <div class="[ wk_login_input ][ ]"> <label for="wk_lastname">Apellido</label><span class="required">*</span> <input type="text" placeholder="" name="wk_lastname" id="wk_lastname" class="[ wk_loginput ][ xmall-12 ]"/> <div class="error-class" id="seller_last_name"></div> </div> <div class="[ wk_login_input ][ ]"> <label for="wk_useremail"><?php _e("E-mail"); ?> </label><span class="required">*</span> <input type="text" placeholder="" name="wk_useremail" id="wk_useremail" class="[ wk_loginput ][ xmall-12 ]"/> <div class="error-class" id="seller_email"></div> </div> <div id="add_sller_shop"></div> <div class="[ wk_login_input ][ ]"> <label for="wk_userseller" name="user_email" class="wk_regis"><?php _e("Want To Become A Seller"); ?> </label><span class="required">*</span> <input type="radio" name="selleraccess" value="1" class="wk_userseller"> <?php _e("Yes"); ?>   <input type="radio" name="selleraccess" value="0" class="wk_userseller"> <?php _e("No"); ?> <div class="error-class" id="select-seller_access"></div> </div> <?php apply_filters('register_url', 'seller registration'); ?> <div class="[ wk_login_input ][ ]"> <div><img src="<?php echo plugins_url(); ?> /marketplace/includes/front/my-image.php" id="wk_captcha_image"></div> <label for="wk_captcha">Escribe el texto del captcha:</label> <input class="[ xmall-12 ]" type="text" name="wk_captcha" id="wk_captcha"> <input type="hidden" id="wk_captcha_result" name="wk_captcha_result" value="0"> <div class="error-class" id="wk_captcha_error"></div> <div class="correct-class" id="wk_captcha_correct"></div> </div> <div class="[ text-center ]"> <input type="submit" value="Register" class="[ button button--primary ][ ]" name="register_submit" id="register_submit"/> <a style="text-decoration: none;" href="<?php echo get_permalink(); ?> "> <input class="[ button button--primary ][ ]" type="button" value="<?php _e("Login"); ?> "> </a> </div> </form> </div> <?php } else { if (isset($_GET['action']) && !$user_status && $_GET['action'] == 'lostpassword') { ?> <section id="contentForm"> <form name="lostpasswordform" id="lostpasswordform" action="" method="post"> <!--<h1>Reset</h1>--> <div> <input type="text" name="user_login" id="user_login" placeholder="Username or E-mail" value="" required="" size="20" tabindex="10"> </div> <div> <input type="hidden" name="redirect_to" value="<?php echo get_permalink(); ?> "> <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Get Password" tabindex="100"> <a href="<?php echo get_permalink(); ?> ">Login Now</a> </div> </form> </section> <?php } } } } }
/** * @deprecated */ function woocommerce_lostpassword_url($url) { return wc_lostpassword_url($url); }
<?php do_action( 'woocommerce_login_form_start' ); ?> <?php if ($message) echo wpautop(wptexturize($message)); ?> <p class="form-row form-row-first"> <label for="username"><?php _e('Username or email', 'yit'); ?> <span class="required">*</span></label> <input type="text" class="input-text" name="username" id="username" /> </p> <p class="form-row form-row-last"> <label for="password"><?php _e('Password', 'yit'); ?> <span class="required">*</span></label> <input class="input-text" type="password" name="password" id="password" /> </p> <div class="clear"></div> <?php do_action( 'woocommerce_login_form' ); ?> <p class="form-row"> <?php wp_nonce_field( 'woocommerce-login' ) ?> <input type="submit" class="button" name="login" value="<?php _e('Login', 'yit'); ?>" /> <input type="hidden" name="redirect" value="<?php echo esc_url($redirect) ?>" /> <label for="rememberme" class="inline"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'yit' ); ?> </label> <a class="lost_password" href="<?php echo esc_url( wc_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'yit' ); ?></a> </p> <div class="clear"></div> <?php do_action( 'woocommerce_login_form_end' ); ?> </form>
function etheme_login_form_modal() { global $woocommerce; ?> <div id="loginModal" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true"> <div> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 class="title"><span><?php _e('Login', ETHEME_DOMAIN); ?> </span></h3> </div> <div class="modal-body"> <?php do_action('etheme_before_login'); ?> <form method="post" class="login"> <p class="form-row form-row-<?php if (get_option('woocommerce_enable_myaccount_registration') == 'yes') { ?> wide<?php } else { ?> first<?php } ?> "> <label for="username"><?php _e('Username or email', ETHEME_DOMAIN); ?> <span class="required">*</span></label> <input type="text" class="input-text" name="username" id="username" /> </p> <p class="form-row form-row-<?php if (get_option('woocommerce_enable_myaccount_registration') == 'yes') { ?> wide<?php } else { ?> last<?php } ?> "> <label for="password"><?php _e('Password', ETHEME_DOMAIN); ?> <span class="required">*</span></label> <input class="input-text" type="password" name="password" id="password" /> </p> <div class="clear"></div> <p class="form-row"> <?php wp_nonce_field('woocommerce-login'); ?> <input type="submit" class="button filled active" name="login" value="<?php _e('Login', ETHEME_DOMAIN); ?> " /> <a class="lost_password" href="<?php echo esc_url(wc_lostpassword_url()); ?> "><?php _e('Lost Password?', ETHEME_DOMAIN); ?> </a> <a href="<?php echo get_permalink(get_option('woocommerce_myaccount_page_id')); ?> " class="right"><?php _e('Create Account', ETHEME_DOMAIN); ?> </a> </p> </form> </div> </div> </div> <?php }
function bearded_woocommerce_nav() { global $wp, $post, $yith_wcwl; if (function_exists('is_woocommerce')) { ?> <nav class="shop-nav"> <ul class="account-menu"> <?php if (is_user_logged_in()) { ?> <li class="my-account <?php echo !empty($post) && $post->ID == wc_get_page_id('myaccount') && !array_key_exists(get_option('woocommerce_myaccount_edit_account_endpoint'), $wp->query_vars) ? 'active' : ''; ?> "> <a class="tiptip icon-user" title="<?php _e('My Account', 'bearded'); ?> " href="<?php echo get_permalink(wc_get_page_id('myaccount')); ?> "> <span class="link-title"><?php _e('My Account', 'bearded'); ?> </span> </a> </li> <li class="edit-account <?php echo !empty($post) && $post->ID == wc_get_page_id('myaccount') && array_key_exists(get_option('woocommerce_myaccount_edit_account_endpoint'), $wp->query_vars) ? 'active' : ''; ?> "> <a class="tiptip icon-pencil" title="<?php _e('Edit Account', 'bearded'); ?> " href="<?php echo wc_customer_edit_account_url(); ?> "> <span class="link-title"><?php _e('Edit Account', 'bearded'); ?> </span> </a> </li> <li class="visit-shop <?php echo get_query_var('post_type') == 'product' ? 'active' : ''; ?> "> <a class="tiptip icon-home" title="<?php _e('Visit Shop', 'bearded'); ?> " href="<?php echo get_permalink(wc_get_page_id('shop')); ?> "> <span class="link-title"><?php _e('Visit Shop', 'bearded'); ?> </span> </a> </li> <?php if ($yith_wcwl) { ?> <li class="wishlist <?php echo !empty($post) && $post->ID == get_option('yith_wcwl_wishlist_page_id') ? 'active' : ''; ?> "> <a class="tiptip icon-magic" title="<?php _e('View Wishlist', 'bearded'); ?> " href="<?php echo $yith_wcwl->get_wishlist_url(); ?> "> <span class="link-title"><?php _e('View Wishlist', 'bearded'); ?> </span> </a> </li> <?php } ?> <li class="logout"> <a class="tiptip icon-signout" title="<?php _e('Logout', 'bearded'); ?> " href="<?php echo wp_logout_url($_SERVER['REQUEST_URI']); ?> "> <span class="link-title"><?php _e('Logout', 'bearded'); ?> </span> </a> </li> <?php } else { ?> <li class="visit-shop <?php echo get_query_var('post_type') == 'product' ? 'active' : ''; ?> "> <a class="tiptip icon-home" title="<?php _e('Visit Shop', 'bearded'); ?> " href="<?php echo get_permalink(wc_get_page_id('shop')); ?> "> <span class="link-title"><?php _e('Visit Shop', 'bearded'); ?> </span> </a> </li> <li class="login <?php echo !empty($post) && $post->ID == wc_get_page_id('myaccount') && !array_key_exists(get_option('woocommerce_myaccount_lost_password_endpoint'), $wp->query_vars) ? 'active' : ''; ?> "> <a class="tiptip icon-signin" title="<?php _e('Login', 'bearded'); ?> " href="<?php echo get_permalink(wc_get_page_id('myaccount')); ?> "> <span class="link-title"><?php _e('Login', 'bearded'); ?> </span> </a> </li> <li class="lost-password <?php echo !empty($post) && $post->ID == wc_get_page_id('myaccount') && array_key_exists(get_option('woocommerce_myaccount_lost_password_endpoint'), $wp->query_vars) ? 'active' : ''; ?> "> <a class="tiptip icon-key" title="<?php _e('Lost Password', 'bearded'); ?> " href="<?php echo wc_lostpassword_url(); ?> "> <span class="link-title"><?php _e('Lost Password', 'bearded'); ?> </span> </a> </li> <?php } ?> </ul> <ul class="cart"> <li class="cart-container"> <?php bearded_cart_widget(); ?> </li> </ul> </nav> <?php } }
update_post_meta($post_id, 'audio_setting', sanitize_text_field($_POST['audio_setting'])); update_post_meta($post_id, 'video_setting', sanitize_text_field($_POST['video_setting'])); } } /*---------------shortcode for div ----------------------------*/ JVLibrary::jvShortcode('shortcode', 'shortcode_func'); function shortcode_func($att, $content = null) { $class = isset($att['class']) ? "class='" . $att['class'] . "'" : ""; $id = isset($att['id']) ? "id='" . $att['id'] . "'" : ""; $content = str_replace('<br />', '', $content); $content = str_replace('<p>', '', $content); $content = str_replace('</p>', '', $content); return '<article ' . $class . ' ' . $id . '>' . do_shortcode($content) . '</article>'; } JVLibrary::jvShortcode('section', 'section_func'); function section_func($att, $content = null) { $class = isset($att['class']) ? "class='" . $att['class'] . "'" : ""; $id = isset($att['id']) ? "id='" . $att['id'] . "'" : ""; return '<section ' . $class . ' ' . $id . '>' . do_shortcode($content) . '</section>'; } JVLibrary::jvShortcode('container', 'container_func'); function container_func($att, $content = null) { return '<div class="container">' . do_shortcode($content) . '</div>'; } JVLibrary::jvShortcode('row', 'row_func'); function row_func($att, $content = null) { return '<div class="row">' . do_shortcode($content) . '</div>'; } JVLibrary::jvShortcode('div', 'div_func'); function div_func($att, $content = null) { $class = isset($att['class']) ? "class='" . $att['class'] . "'" : ""; $id = isset($att['id']) ? "id='" . $att['id'] . "'" : ""; return '<div ' . $class . ' ' . $id . '>' . do_shortcode($content) . '</div>'; } JVLibrary::jvShortcode('col', 'col_func'); function col_func($att, $content = null) { $class = isset($att['class']) ? "class='" . $att['class'] . "'" : ""; $id = isset($att['id']) ? "id='" . $att['id'] . "'" : ""; return '<div ' . $class . ' ' . $id . '>' . do_shortcode($content) . '</div>'; } JVLibrary::jvShortcode('p', 'p_func'); function p_func($att, $content = null) { $class = isset($att['class']) ? "class='" . $att['class'] . "'" : ""; $id = isset($att['id']) ? "id='" . $att['id'] . "'" : ""; return '<p ' . $class . ' ' . $id . '>' . do_shortcode($content) . '</p>'; } JVLibrary::jvShortcode('jv_video', 'video_func'); function video_func($att, $content = null) { $iframe = "iframe"; $width = isset($att['width']) ? 'width="' . $att['width'] . '"' : ""; $height = isset($att['height']) ? 'height="' . $att['height'] . '"' : ""; if (strpos($content, 'youtube.com')) { $id_video = substr($content, strrpos($content, "=") + 1); return '<' . $iframe . ' src="https://www.youtube.com/embed/' . $id_video . '" frameborder="0" ' . $width . ' ' . $height . ' allowfullscreen></' . $iframe . '>'; } else { $id_video = substr($content, strrpos($content, "/") + 1); return '<' . $iframe . ' src="https://player.vimeo.com/video/' . $id_video . '" ' . $width . ' ' . $height . ' ></' . $iframe . '>'; } } JVLibrary::jvShortcode('jv_audio', 'audio_func'); function audio_func($att, $content = null) { $iframe = "iframe"; $width = isset($att['width']) ? 'width="' . $att['width'] . '"' : ""; $height = isset($att['height']) ? 'height="' . $att['height'] . '"' : ""; $url_api = 'https://api.soundcloud.com/resolve.json?url=' . $content . '&client_id=b45b1aa10f1ac2941910a7f0d10f8e28'; global $wp_filesystem; $result = $wp_filesystem->get_contents($url_api); if (isset($result)) { $api = json_decode($result); if (isset($api->id)) { return '<' . $iframe . ' ' . $width . ' ' . $height . ' scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/' . $api->id . '&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true"></' . $iframe . '>'; } else { return "Can not load content from https://soundcloud.com/"; } } else { return "Invalid url of https://soundcloud.com/"; } } JVLibrary::jvShortcode('home_url', 'home_url_func'); function home_url_func() { return home_url(); } JVLibrary::jvShortcode('woo_login_form', 'woo_login_form_func'); function woo_login_form_func() { ob_start(); global $post; if (is_user_logged_in()) { $current_user = wp_get_current_user(); $actual_link = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>
<?php do_action( 'woocommerce_login_form' ); ?> <p class="form-row remember"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" checked /> <label for="rememberme" class="inline remember_checkbox"> </label> Recordar sesión. </p> <p class="form-row"> <?php wp_nonce_field( 'woocommerce-login' ); ?> <input type="submit" class="button " name="login" value="<?php _e( 'Enviar ', 'woocommerce' ); ?>" /> </p> <p class="lost_password"> <a href="<?php echo esc_url( wc_lostpassword_url() ); ?>"><?php _e( 'Olvidaste tu Contraseña?', 'woocommerce' ); ?></a> </p> <p class="wc_account"> <a data-toggle="modal" data-target="#modal__register_wc" data-dismiss="modal" href="#">Aún no tienes tu cuenta. Regístrate aquí</a> </p> <?php do_action( 'woocommerce_login_form_end' ); ?> </form> <!-- /form --> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </section><!-- /.modal__login_wc --> <!-- Modal para el registro en woocommerce ( Nuevo ) --> <section class="modal fade fade modal__wc" id="modal__register_wc" tabindex="-1" role="dialog" aria-labelledby="modal__login_wc" aria-hidden="true">
function widget($args, $instance) { $show_logged_out = isset($instance['show_logged_out']) ? $instance['show_logged_out'] : 'yes'; $show_logged_in = isset($instance['show_logged_in']) ? $instance['show_logged_in'] : 'yes'; $title_logged_out = isset($instance['title_logged_out']) ? $instance['title_logged_out'] : ''; $nav_menu = isset($instance['nav_menu']) ? wp_get_nav_menu_object($instance['nav_menu']) : ''; $nav_show_wishlist = isset($instance['nav_show_wishlist']) && $instance['nav_show_wishlist'] == 'yes' && defined('YITH_WCWL') ? true : false; $nav_show_wpml_menu = isset($instance['nav_show_wpml_menu']) && $instance['nav_show_wpml_menu'] == 'yes' && defined('ICL_SITEPRESS_VERSION') ? true : false; // var_dump($instance); $logged_in = false; if (is_user_logged_in()) { $logged_in = true; global $current_user; get_currentuserinfo(); $user_name = $current_user->display_name; if (empty($user_name)) { $user_name = __('user', 'yit'); } ?> <!-- START LOGGED IN NAVIGATION --> <div id="welcome-menu" class="nav dropdown"> <ul> <li class="menu-item<?php if ($show_logged_in == 'yes') { echo ' dropdown'; } ?> "> <a href="<?php echo get_permalink(wc_get_page_id('myaccount')); ?> "> <span class="welcome_username"><?php echo apply_filters('yit_welcome_login_label', __('Hi', 'yit')); ?> <?php echo apply_filters('yit_welcome_username', $user_name); ?> </span> </a> <?php if ($show_logged_in == 'yes') { include_once YIT_THEME_ASSETS_PATH . '/lib/Walker_Nav_Menu_Div.php'; $nav_args = array('menu' => $nav_menu, 'container' => 'div', 'container_class' => 'submenu', 'menu_class' => 'sub-menu clearfix', 'depth' => 1, 'walker' => new YIT_Walker_Nav_Menu_Div()); wp_nav_menu($nav_args); } ?> </li> </ul> </div> <!-- END LOGGED IN NAVIGATION --> <?php } else { $enabled_registration = get_option('woocommerce_enable_myaccount_registration'); $enabled_registration_class = $enabled_registration === 'yes' ? 'with_registration' : ''; $profile_link = is_shop_installed() ? get_permalink(wc_get_page_id('myaccount')) : wp_login_url(); ?> <div id="welcome-menu-login" class="nav"> <ul id="menu-welcome-login"> <li class="menu-item login-menu<?php if ($show_logged_out == 'yes') { echo ' dropdown'; } ?> "> <a href="<?php echo esc_url($profile_link); ?> "><?php echo $title_logged_out; ?> </a> <?php if ($show_logged_out == 'yes') { ?> <div class="submenu clearfix"> <div class="clearfix login-box <?php echo esc_attr($enabled_registration_class); ?> "> <div id="customer_login"> <div class="customer-login-box customer-login-box1"> <form method="post" class="login"> <?php do_action('woocommerce_login_form_start'); ?> <div class="form-group"> <label for="username"><?php _e('Username or email address', 'yit'); ?> <span class="required">*</span></label> <input type="text" class="form-control" name="username" id="username" /> </div> <div class="form-group"> <label for="password"><?php _e('Password', 'yit'); ?> <span class="required">*</span></label> <input class="form-control" type="password" name="password" id="password" /> </div> <?php do_action('woocommerce_login_form'); ?> <div class="form-group login-submit"> <?php wp_nonce_field('woocommerce-login'); ?> <input type="submit" class="button btn btn-flat-red button-login" name="login" value="<?php _e('Login', 'yit'); ?> " /> <p class="lost_password"> <?php if (function_exists('wc_lostpassword_url')) { ?> <a href="<?php echo esc_url(wc_lostpassword_url()); ?> "><?php _e('Lost password?', 'yit'); ?> </a><br /> <?php } ?> <?php if ($enabled_registration === 'yes') { ?> <?php _e('New Customer ?', 'yit'); ?> <a class="signup" href="<?php echo esc_url(is_shop_installed() ? get_permalink(wc_get_page_id('myaccount')) : wp_registration_url()); ?> "><?php _e('Sign up', 'yit'); ?> </a> <?php } ?> </p> <!-- <label for="rememberme" class="inline"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e('Remember me', 'yit'); ?> </label> --> </div> <?php do_action('woocommerce_login_form_end'); ?> </form> </div> </div> </div> </div> <?php } ?> </li> </ul> </div> <?php } if ($nav_show_wishlist) { ?> <div class="nav whislist_nav"> <ul> <li> <a href="<?php echo wc_get_endpoint_url('wishlist', '', get_permalink(wc_get_page_id('myaccount'))); ?> "><?php _e('My Wishlist', 'yit'); ?> </a> </li> </ul> </div> <?php } }
function spreview() { ?> <style type="text/css"> header h1 { display:none; } aside { display:none; } #main { width:100%; } </style> <?php global $wpdb; $wpmp_obj10 = new MP_Form_Handler(); include 'facebookv2/src/facebook.php'; /********************************************************faceboook*********************************************************/ if (isset($_GET['checkpoint'])) { $checkpoint = $_GET['checkpoint']; $appid = get_option('wkfb_mp_key_app_ID'); $secretkey = get_option('wkfb_mp_app_secret_key'); if ($checkpoint && $appid && $secretkey) { $key = $_GET['key']; $facebook = new Facebook(array('appId' => $appid, 'secret' => $secretkey, 'cookie' => true)); $req_perms = "user_likes,public_profile,publish_stream,offline_access,user_status,email,read_stream"; $session = $facebook->getUser(); $loginUrl = $facebook->getLoginUrl(array('canvas' => 1, 'fbconnect' => 0, 'req_perms' => $req_perms)); $user_info = null; if (!$session) { echo "<script type='text/javascript'>top.location.href ='" . $loginUrl . "';</script>"; } else { try { $fbemail = $facebook->api('/me?fields=email&access_token=' . $key); $user_info = $facebook->api('/me'); } catch (FacebookApiException $e) { //echo "<script type='text/javascript'>top.location.href = '".$loginUrl."';</script>"; } } $wk_user_name = $user_info['name']; $registerDate = date('Y-m-d H:i:s'); $first_name = $user_info['first_name']; $last_name = $user_info['last_name']; $wk_email = $fbemail['email']; $login_name = explode('@', $fbemail['email']); $user_url = $user_info['link']; $wk_random_password = wp_generate_password(); if (!email_exists($wk_email)) { $user_id = wp_create_user($wk_email, $wk_random_password, $wk_email); update_user_meta($newuser_id, 'first_name', $first_name); update_user_meta($newuser_id, 'last_name', $last_name); /*MP_Form_Handler::mp_user_welcome($user_id,$wk_random_password);*/ $wpmp_obj10->mp_user_welcome($user_id, $wk_random_password); if (!is_wp_error($user_id)) { wp_set_current_user($user_id); // set the current wp user wp_set_auth_cookie($user_id); /*$page_id=MP_Form_Handler::get_page_id(get_option('wkmp_seller_login_page_tile'));*/ $page_id = $wpmp_obj10->get_page_id(get_option('wkmp_seller_login_page_tile')); wp_redirect(home_url('?page_id=' . $page_id) . '&page=eFeed&sid=' . $_GET['sid']); exit; } } else { $user = get_user_by('email', $wk_email); $user_id = (int) $user->data->ID; $user_id = wp_update_user(array('ID' => $user_id, 'user_pass' => $wk_random_password)); if (!is_wp_error($user_id)) { wp_set_current_user($user_id); // set the current wp user wp_set_auth_cookie($user_id); /*$page_id=MP_Form_Handler::get_page_id(get_option('wkmp_seller_login_page_tile'));*/ $page_id = $wpmp_obj10->get_page_id(get_option('wkmp_seller_login_page_tile')); wp_redirect(home_url('?page_id=' . $page_id) . '&page=eFeed&sid=' . $_GET['sid']); exit; } } } } /********************************************************faceboook*********************************************************/ $sellerid = $_GET['sid']; $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); /*$sell_data=MP_Form_Handler::spreview($sellerid);*/ $sell_data = $wpmp_obj10->spreview($sellerid); /*$seller_product=MP_Form_Handler::seller_product($sellerid);*/ $seller_product = $wpmp_obj10->seller_product($sellerid); $lenghtProduct = count($seller_product); foreach ($sell_data as $key => $value) { $seller_all[$value->meta_key] = $value->meta_value; } /*$selleravatar=MP_Form_Handler::get_user_avatar($sellerid,'avatar');*/ $selleravatar = $wpmp_obj10->get_user_avatar($sellerid, 'avatar'); $user_value = is_user_logged_in(); ?> <div id="seller"> <div class="mp_main_left"> <div style="margin-bottom:10px;"> <?php if (isset($selleravatar[0]->meta_value)) { echo '<img src="' . content_url() . '/uploads/' . $selleravatar[0]->meta_value . '">'; } else { echo '<div class="editmp_img" id="mp_seller_image"><img src="' . content_url() . '/plugins/marketplace/assets/images/genric-male.png" /></div>'; } ?> </div> <div style="float:left;width:100%;"> <?php $varsid = get_query_var('sid'); if (empty($varsid)) { $varsid = $_GET['sid']; } if (strchr(get_permalink(), '?')) { $icon = '&'; } else { $icon = '?'; } ?> <a class="button btn btn-default button-medium" href="<?php echo get_permalink() . $icon; ?> page=sprod&sid=<?php echo $varsid; ?> "> <span>View Collection</span> </a> </div> </div> <div class="mp_main_right"> <div class="page-title"> <div class="sell_head">Seller Profile</div> </div> <div class="box-account"> <div class="box-head"> <h2 class='about'><?php _e('About Shop'); ?> </h2> <p><?php echo isset($seller_all['about_shop']) ? $seller_all['about_shop'] : 'N/A'; ?> </p> <div class="wk_border_line"></div> </div> <div class="box-content" style="background-color:#F6F6F6;border-bottom: 3px solid #D5D3D4;"> <div class="seller_name"><?php echo $seller_all['nickname']; ?> </div> <div class="wk-left-label"> <div class="wk_row"> <label class="wk-mail-icon">Business Email -</label> <span><?php echo isset($seller_all['billing_email']) ? isset($seller_all['billing_email']) ? $seller_all['billing_email'] : 'N/A' : 'N/A'; ?> </span> </div> <div class="wk_row"> <label class="wk-phone-icon">Phone -</label> <span><?php echo isset($seller_all['billing_phone']) ? isset($seller_all['billing_phone']) ? $seller_all['billing_phone'] : 'N/A' : 'N/A'; ?> </span> </div> <div class="wk_row"> <label class="wk-address-icon">Address -</label> <span><?php echo isset($seller_all['shop_address']) ? isset($seller_all['shop_address']) ? $seller_all['shop_address'] : 'N/A' : 'N/A'; ?> </span> </div> <div class="wk_row"> <label class="wk-share-icon">Social Profile -</label> <span class="wk-social-icon"> <?php if (isset($seller_all['social_facebook'])) { ?> <a id="mp_facebook" href="<?php echo $seller_all['social_facebook']; ?> " target='_blank'></a> <?php } if (isset($seller_all['social_twitter'])) { ?> <a id="mp_twitter" href="<?php echo $seller_all['social_twitter']; ?> " target='_blank'></a> <?php } if (isset($seller_all['social_gplus'])) { ?> <a id="mp_gplus" href="<?php echo $seller_all['social_gplus']; ?> " target='_blank'></a> <?php } if (isset($seller_all['social_linkedin'])) { ?> <a id="mp_linkedin" href="<?php echo $seller_all['social_linkedin']; ?> " target='_blank'></a> <?php } if (isset($seller_all['social_youtube'])) { ?> <a id="mp_youtube" href="<?php echo $seller_all['social_youtube']; ?> " target='_blank'></a> <?php } ?> </span> </div> <div class="wk_row"> <label class="wk-rating-icon">Seller Rating -</label> <span class="avg_rating" title="good" style="width: 100px;"> <?php if ($sell_data[0]->user_id = '1') { /*$Result=MP_Form_Handler::original_review($sellerid);*/ $Result = $wpmp_obj10->original_review($sellerid); //print_r($Result); $num_of_stars = 0; $total_feedback = 0; foreach ($Result as $item) { $num_of_stars = $num_of_stars + $item->price_r; $num_of_stars = $num_of_stars + $item->value_r; $num_of_stars = $num_of_stars + $item->quality_r; $total_feedback++; } if ($num_of_stars != 0) { $review = $num_of_stars / (15 * $total_feedback) * 100; $quality = $review / 100 * 5; } else { $quality = 0; } for ($i = 0; $i <= 4; $i++) { if ($i < $quality) { echo '<div class="wk_ystar"></div>'; } else { echo '<div class="wk_gstar"></div>'; } } } ?> <input type="hidden" name="score" value="<?php echo $quality; ?> " readonly="readonly"> </span> <?php if (get_current_user_id()) { ?> <div class="wk_write_review"> <a class="btn btn-default button button-small open-review-form forloginuser wk_mpsocial_feedback" href="#wk_review_form"> <span>Write a Review !</span> </a> </div> <?php } else { ?> <div class="wk_write_review"> <a class="btn btn-default button button-small open-review-form forloginuser wk_mpsocial_feedback" href="javascript:void(0);"> <span>Write a Review !</span> </a> </div> <?php } ?> </div> </div> </div> </div> <div class="box-account"> <div class="box-head"> <h2>Recent Products</h2> <div class="wk_border_line"></div> </div> <?php if ($lenghtProduct > 0) { ?> <div class="box-content wk_slider_padding"> <div class="wk-product-slider"> <?php if ($lenghtProduct > 3) { ?> <div class="bx-next-slider"></div> <div class="bx-prev-slider"></div> <div class="view-port-mp-slider"> <div class="view-port-mp-slider-absolute"> <?php foreach ($seller_product as $item) { $product_object = get_product($item->ID); $product_price = $wpdb->get_var("select meta_value from {$wpdb->postmeta} where post_id={$item->ID} and meta_key='_price'"); /*$product_image=MP_Form_Handler::get_product_image($item->ID,'_thumbnail_id');*/ $product_image = $wpmp_obj10->get_product_image($item->ID, '_thumbnail_id'); $link = get_permalink($item->ID); ?> <a class="product_img_link" title="<?php echo $item->post_title; ?> " href="<?php echo $link; ?> "> <div class="mp-box-slider"> <div class="mp-box-slider-img-data"> <div class="mp-box-slider-img-hidden"> <?php if ($product_image != '') { ?> <img style="margin:0;padding:0;" class="mp-box-slider-img" alt="<?php echo $item->post_title; ?> " src="<?php echo content_url() . '/uploads/' . $product_image; ?> "> <?php } else { ?> <img style="margin:0;padding:0;" class="mp-box-slider-img" alt="<?php echo $item->post_title; ?> " src="<?php echo plugins_url('marketplace/assets/images/placeholder.png'); ?> "> <?php } ?> </div> <div><?php echo $item->post_title; ?> </div> <div> <?php if ($product_object->is_type('simple')) { ?> <span class="amount"><?php echo woocommerce_price($product_object->price); ?> </span> <?php } else { if ($product_object->is_type('variable')) { ?> <span class="price"> <span class="amount"><?php echo woocommerce_price($product_object->min_variation_price); ?> </span> – <span class="amount"><?php echo woocommerce_price($product_object->max_variation_price); ?> </span> </span> <?php } else { if ($product_object->is_type('external')) { ?> <span class="amount"><?php echo woocommerce_price($product_object->price); ?> </span> <?php } else { if ($product_object->is_type('grouped')) { } } } } ?> </div> </div> </div> </a> <?php } ?> </div> </div> <?php } else { ?> <div class="view-port-mp-slider"> <div class="view-port-mp-slider-absolute"> <?php foreach ($seller_product as $item) { // $product_price=$wpdb->get_var("select meta_value from $wpdb->postmeta where post_id=$item->ID and meta_key='_price'"); $product_object = get_product($item->ID); $product_price = get_post_meta($item->ID, '_price', true); /*$product_image=MP_Form_Handler::get_product_image($item->ID,'_thumbnail_id');*/ $product_image = $wpmp_obj10->get_product_image($item->ID, '_thumbnail_id'); $link = get_permalink($item->ID); ?> <a class="product_img_link" title="<?php echo $item->post_title; ?> " href="<?php echo $link; ?> "> <div class="mp-box-slider"> <div class="mp-box-slider-img-data"> <div class="mp-box-slider-img-hidden"> <?php if ($product_image != '') { ?> <img style="margin:0;padding:0;" class="mp-box-slider-img" alt="<?php echo $item->post_title; ?> " src="<?php echo content_url() . '/uploads/' . $product_image; ?> "> <?php } else { ?> <img style="margin:0;padding:0;" class="mp-box-slider-img" alt="<?php echo $item->post_title; ?> " src="<?php echo plugins_url('marketplace/assets/images/placeholder.png'); ?> "> <?php } ?> </div> <div><?php echo $item->post_title; ?> </div> <div> <?php if ($product_object->is_type('simple')) { ?> <span class="amount"><?php echo woocommerce_price($product_object->price); ?> </span> <?php } else { if ($product_object->is_type('variable')) { ?> <span class="price"> <span class="amount"><?php echo woocommerce_price($product_object->min_variation_price); ?> </span> – <span class="amount"><?php echo woocommerce_price($product_object->max_variation_price); ?> </span> </span> <?php } else { if ($product_object->is_type('external')) { ?> <span class="amount"><?php echo woocommerce_price($product_object->price); ?> </span> <?php } else { if ($product_object->is_type('grouped')) { } } } } ?> </div> </div> </div> </a> <?php } ?> </div> </div> <?php } ?> </div> </div> <?php } else { ?> <div class="box-content wk_slider_padding"> <p> Sorry, No Product Available. </p> </div> <?php } ?> </div> <?php if ($total_feedback > 0) { ?> <div class="box-account"> <?php $seller_review_last = $Result[$total_feedback - 1]; ?> <div class="box-head"> <div class="wk_review_head"> <h2>Reviews about seller</h2> </div> <div class="wk_border_line"></div> </div> <div class="box-content"> <div id="show_single_review_mp"> <div class="wk-reviews"> <div class="wk-writer-info"> <div class="wk-writer-details"> <ul> <li class="wk-person-icon"><?php echo $seller_review_last->nickname; ?> </li> <!-- <li class="wk-mail-icon">dheeraj@webkul.com</li> --> <li class="wk-watch-icon"><?php echo $seller_review_last->review_time; ?> </li> </ul> </div> <div class="wk-seller-rating"> <?php $oneu_of_stars = 0; $oneu_of_stars = $oneu_of_stars + $seller_review_last->price_r; $oneu_of_stars = $oneu_of_stars + $seller_review_last->value_r; $oneu_of_stars = $oneu_of_stars + $seller_review_last->quality_r; $last_user_review = $oneu_of_stars / 3; for ($i = 0; $i < 5; $i++) { if ($i < $last_user_review) { echo '<div class="wk_ystar"></div>'; } else { echo '<div class="wk_gstar"></div>'; } } ?> </div> </div> <div class="wk_review_content"><?php echo $seller_review_last->review_desc; ?> </div> </div></div> <div id="show_all_review" style="display:none;"> <?php foreach ($Result as $seller_review_last) { ?> <div class="wk-reviews"> <div class="wk-writer-info"> <div class="wk-writer-details"> <ul> <li class="wk-person-icon"><?php echo $seller_review_last->nickname; ?> </li> <!-- <li class="wk-mail-icon">dheeraj@webkul.com</li> --> <li class="wk-watch-icon"><?php echo $seller_review_last->review_time; ?> </li> </ul> </div> <div class="wk-seller-rating"> <?php $oneu_of_stars = 0; $oneu_of_stars = $oneu_of_stars + $seller_review_last->price_r; $oneu_of_stars = $oneu_of_stars + $seller_review_last->value_r; $oneu_of_stars = $oneu_of_stars + $seller_review_last->quality_r; $last_user_review = $oneu_of_stars / 3; for ($i = 0; $i < 5; $i++) { if ($i < $last_user_review) { echo '<div class="wk_ystar"></div>'; } else { echo '<div class="wk_gstar"></div>'; } } ?> </div> </div> <div class="wk_review_content"><?php echo $seller_review_last->review_desc; ?> </div> </div> <?php } ?> </div> <div class="wk_border_line"></div> <a href="javascript:void(0);" class="button"><span id="view_all_review_button">View all reviews</span></a> </div> </div> <?php } ?> </div> </div> <div class="wk_feedback_popup"> <input type='hidden' value="<?php echo $user_value; ?> " id="feedbackloged_in_status" /> <div id="fb-root"></div> <div class="wk_cross_login"></div> <?php $feedback_url = ''; ?> <div id='feedback_form'> <?php wc_print_notices(); ?> <form action="<?php $params = array('page' => "eFeed", 'sid' => $_GET['sid']); $url = add_query_arg($params, get_permalink()); echo $url; ?> " method="post" class="login"> <p class="form-row form-row-wide"> <label for="username"><?php _e('Username or email address', 'marketplace'); ?> <span class="required">*</span></label> <input type="text" class="input-text" name="wkmp_username" id="username" value="<?php if (!empty($_POST['username'])) { echo esc_attr($_POST['username']); } ?> " /> </p> <p style="display:none;"> <input type="hidden" name="wkfb_mp_key_app_idID" id="wkfb_mp_key_app_idID" value="<?php echo get_option('wkfb_mp_key_app_ID'); ?> " /> <input type="hidden" name="wkfb_mp_app_secret_kekey" id="wkfb_mp_app_secret_kekey" value="<?php echo get_option('wkfb_mp_app_secret_key'); ?> " /> <input type="hidden" name="wkfacebook_login_page_id" id="wkfacebook_login_page_id" value="<?php echo $wpmp_obj10->get_page_id("'" . get_option('wkmp_seller_login_page_tile') . "'"); ?> " /> </p> <p class="form-row form-row-wide"> <label for="password"><?php _e('Password', 'marketplace'); ?> <span class="required">*</span></label> <input class="input-text" type="password" name="password" id="password" /> </p> <!-- <label for="rememberme" class="inline"> <input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e('Remember me', 'marketplace'); ?> </label> --> <p class="form-row mp-login-button"> <?php wp_nonce_field('marketplace-user'); ?> <input type="submit" class="button" id='submit-btn-feedback' name="login" value="<?php _e('Login', 'marketplace'); ?> " /> <!--<a href="<?php echo wp_registration_url(); ?> " class="button"><?php _e("Register"); ?> </a> --> <a href="<?php echo esc_url(wc_lostpassword_url()); ?> "><?php _e('Lost your password?', 'marketplace'); ?> </a> <a href="javascript:void(0);"><img border="0" id='mp-fb-login-btn'/></a> <!-- <div class="fb-login-button" data-max-rows="1" data-size="medium" data-show-faces="false" data-auto-logout-link="false"></div> --> </p> <!-- <p class="lost_password"> </p> --> </form> </div> </div> <?php }