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 }