/**
  * Submit a comment for an order
  *
  * @param object $orders
  *
  * @return unknown
  */
 public static function new_comment($orders)
 {
     global $woocommerce;
     $user = wp_get_current_user();
     $user = $user->ID;
     // Security
     if (!wp_verify_nonce($_POST['_wpnonce'], 'add-comment')) {
         return false;
     }
     // Check if this product belongs to the vendor submitting the comment
     $product_id = (int) $_POST['product_id'];
     $author = WCV_Vendors::get_vendor_from_product($product_id);
     if ($author != $user) {
         return false;
     }
     // Find the order belonging to this comment
     foreach ($orders as $order) {
         if ($order->order_id == $_POST['order_id']) {
             $found_order = $order;
             break;
         }
     }
     // No order was found
     if (empty($found_order)) {
         return false;
     }
     // Don't submit empty comments
     if (empty($_POST['comment_text'])) {
         if (function_exists('wc_add_error')) {
             wc_add_error(__('You\'ve left the comment field empty!', 'wcvendors'));
         } else {
             $woocommerce->add_error(__('You\'ve left the comment field empty!', 'wcvendors'));
         }
         return false;
     }
     // Only submit if the order has the product belonging to this vendor
     $found_order = new WC_Order($found_order->order_id);
     $valid_order = false;
     foreach ($found_order->get_items() as $item) {
         if ($item['product_id'] == $product_id) {
             $valid_order = true;
             break;
         }
     }
     if ($valid_order) {
         $comment = esc_textarea($_POST['comment_text']);
         add_filter('woocommerce_new_order_note_data', array(__CLASS__, 'filter_comment'), 10, 2);
         $found_order->add_order_note($comment, 1);
         remove_filter('woocommerce_new_order_note_data', array(__CLASS__, 'filter_comment'), 10, 2);
         if (function_exists('wc_add_message')) {
             wc_add_message(__('Success. The customer has been notified of your comment.', 'wcvendors'));
         } else {
             $woocommerce->add_message(__('Success. The customer has been notified of your comment.', 'wcvendors'));
         }
     }
 }
 /**
  *
  *
  * @param unknown $items
  * @param unknown $order
  *
  * @return unknown
  */
 public function check_items($items, $order)
 {
     foreach ($items as $key => $product) {
         if (empty($product['product_id'])) {
             unset($items[$key]);
             continue;
         }
         $author = WCV_Vendors::get_vendor_from_product($product['product_id']);
         if ($this->current_vendor != $author) {
             unset($items[$key]);
             continue;
         }
     }
     return $items;
 }
Example #3
0
 function mango_wpvendors_product_seller_name()
 {
     global $mango_settings;
     $product_id = get_the_ID();
     $author = WCV_Vendors::get_vendor_from_product($product_id);
     $vendor_display_name = WC_Vendors::$pv_options->get_option('vendor_display_name');
     switch ($vendor_display_name) {
         case 'display_name':
             $vendor = get_userdata($author);
             $vendor_name = $vendor->display_name;
             break;
         case 'user_login':
             $vendor = get_userdata($author);
             $vendor_name = $vendor->user_login;
             break;
         default:
             $vendor_name = WCV_Vendors::get_vendor_shop_name($author);
             break;
     }
     $sold_by = WCV_Vendors::is_vendor($author) ? sprintf('<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page($author), $vendor_name) : get_bloginfo('name');
     if ($mango_settings['mango_wcvendors_shop_soldby']) {
         echo '<p class="product-seller-name">' . apply_filters('wcvendors_sold_by_in_loop', __('By', 'mango')) . ' <span>' . $sold_by . '</span> </p>';
     }
 }
Example #4
0
 /**
  *
  *
  * @param unknown $order
  * @param unknown $group (optional)
  *
  * @return unknown
  */
 public static function get_vendor_dues_from_order($order, $group = true)
 {
     global $woocommerce;
     $give_tax = WC_Vendors::$pv_options->get_option('give_tax');
     $give_shipping = WC_Vendors::$pv_options->get_option('give_shipping');
     $receiver = array();
     $shipping_given = 0;
     $tax_given = 0;
     WCV_Shipping::$pps_shipping_costs = array();
     foreach ($order->get_items() as $key => $product) {
         $product_id = !empty($product['variation_id']) ? $product['variation_id'] : $product['product_id'];
         $author = WCV_Vendors::get_vendor_from_product($product_id);
         $give_tax_override = get_user_meta($author, 'wcv_give_vendor_tax', true);
         $give_shipping_override = get_user_meta($author, 'wcv_give_vendor_shipping', true);
         $is_vendor = WCV_Vendors::is_vendor($author);
         $commission = $is_vendor ? WCV_Commission::calculate_commission($product['line_subtotal'], $product_id, $order) : 0;
         $tax = !empty($product['line_tax']) ? (double) $product['line_tax'] : 0;
         // Check if shipping is enabled
         if (get_option('woocommerce_calc_shipping') === 'no') {
             $shipping = 0;
             $shipping_tax = 0;
         } else {
             $shipping_costs = WCV_Shipping::get_shipping_due($order->id, $product, $author);
             $shipping = $shipping_costs['amount'];
             $shipping_tax = $shipping_costs['tax'];
         }
         // Add line item tax and shipping taxes together
         $total_tax = (double) $tax + (double) $shipping_tax;
         // Tax override on a per vendor basis
         if ($give_tax_override) {
             $give_tax = true;
         }
         // Shipping override
         if ($give_shipping_override) {
             $give_shipping = true;
         }
         if ($is_vendor) {
             $shipping_given += $give_shipping ? $shipping : 0;
             $tax_given += $give_tax ? $total_tax : 0;
             $give = 0;
             $give += !empty($receiver[$author]['total']) ? $receiver[$author]['total'] : 0;
             $give += $give_shipping ? $shipping : 0;
             $give += $commission;
             $give += $give_tax ? $total_tax : 0;
             if ($group) {
                 $receiver[$author] = array('vendor_id' => (int) $author, 'commission' => !empty($receiver[$author]['commission']) ? $receiver[$author]['commission'] + $commission : $commission, 'shipping' => $give_shipping ? !empty($receiver[$author]['shipping']) ? $receiver[$author]['shipping'] + $shipping : $shipping : 0, 'tax' => $give_tax ? !empty($receiver[$author]['tax']) ? $receiver[$author]['tax'] + $total_tax : $total_tax : 0, 'qty' => !empty($receiver[$author]['qty']) ? $receiver[$author]['qty'] + $product['qty'] : $product['qty'], 'total' => $give);
             } else {
                 $receiver[$author][$key] = array('vendor_id' => (int) $author, 'product_id' => $product_id, 'commission' => $commission, 'shipping' => $give_shipping ? $shipping : 0, 'tax' => $give_tax ? $total_tax : 0, 'qty' => $product['qty'], 'total' => ($give_shipping ? $shipping : 0) + $commission + ($give_tax ? $total_tax : 0));
             }
         }
         $admin_comm = $product['line_subtotal'] - $commission;
         if ($group) {
             $receiver[1] = array('vendor_id' => 1, 'qty' => !empty($receiver[1]['qty']) ? $receiver[1]['qty'] + $product['qty'] : $product['qty'], 'commission' => !empty($receiver[1]['commission']) ? $receiver[1]['commission'] + $admin_comm : $admin_comm, 'total' => !empty($receiver[1]) ? $receiver[1]['total'] + $admin_comm : $admin_comm);
         } else {
             $receiver[1][$key] = array('vendor_id' => 1, 'product_id' => $product_id, 'commission' => $admin_comm, 'shipping' => 0, 'tax' => 0, 'qty' => $product['qty'], 'total' => $admin_comm);
         }
     }
     // Add remainders on end to admin
     $discount = $order->get_total_discount();
     $shipping = $order->order_shipping - $shipping_given;
     $tax = round($order->order_tax + $order->order_shipping_tax - $tax_given, 2);
     $total = $tax + $shipping - $discount;
     if ($group) {
         $receiver[1]['commission'] = $receiver[1]['commission'] - $discount;
         $receiver[1]['shipping'] = $shipping;
         $receiver[1]['tax'] = $tax;
         $receiver[1]['total'] += $total;
     } else {
         $receiver[1][$key]['commission'] = $receiver[1][$key]['commission'] - $discount;
         $receiver[1][$key]['shipping'] = $order->order_shipping - $shipping_given;
         $receiver[1][$key]['tax'] = $tax;
         $receiver[1][$key]['total'] += $total;
     }
     // Reset the array keys
     // $receivers = array_values( $receiver );
     return $receiver;
 }
</h2>
    <?php 
}
?>

	<div class="wcv_shop_description">
		<?php 
echo wpautop($shop_description);
?>
	</div>

	<?php 
if (of_get_option('tokopress_wcvendors_shop_profile') != 'no') {
    ?>
        <?php 
    $author = WCV_Vendors::get_vendor_from_product(get_the_ID());
    $user = get_userdata($author);
    ?>
        <p class="user-social">
        <?php 
    if ($user->facebook_url) {
        ?>
            <span class="user-facebook"><a rel="nofollow" href="<?php 
        echo esc_url($user->facebook_url);
        ?>
"><i class="fa fa-facebook"></i></a></span>
        <?php 
    }
    ?>

        <?php 
Example #6
0
    }
    $vendor_shop = urldecode(get_query_var('vendor_shop'));
    if (!$vendor_shop) {
        return;
    }
    $vendor_id = WCV_Vendors::get_vendor_id($vendor_shop);
    if (!$vendor_id) {
        return;
    }
    $vendor_avatar = of_get_option('tokopress_wcvendors_shop_avatar') != 'no' ? true : false;
    $vendor_profile = of_get_option('tokopress_wcvendors_shop_profile') != 'no' ? true : false;
} else {
    if (of_get_option('tokopress_wcvendors_product_description') != 'yes') {
        return;
    }
    $vendor_id = WCV_Vendors::get_vendor_from_product(get_the_ID());
    if (!$vendor_id) {
        return;
    }
    $vendor_avatar = of_get_option('tokopress_wcvendors_product_avatar') == 'yes' ? true : false;
    $vendor_profile = of_get_option('tokopress_wcvendors_product_profile') != 'no' ? true : false;
}
$vendor = get_userdata($vendor_id);
if (!$vendor) {
    return;
}
$vendor_display_name = WC_Vendors::$pv_options->get_option('vendor_display_name');
switch ($vendor_display_name) {
    case 'display_name':
        $vendor_name = $vendor->display_name;
        break;
function tokopress_wcvendors_seller_info_tab_panel()
{
    $product_id = get_the_ID();
    $author = WCV_Vendors::get_vendor_from_product($product_id);
    $shop_name = WCV_Vendors::get_vendor_shop_name($author);
    echo '<h2>' . $shop_name . '</h2>';
    global $post;
    $seller_info = get_user_meta($post->post_author, 'pv_seller_info', true);
    $has_html = get_user_meta($post->post_author, 'pv_shop_html_enabled', true);
    $global_html = WC_Vendors::$pv_options->get_option('shop_html_enabled');
    $seller_info = do_shortcode($seller_info);
    echo '<div class="pv_seller_info">';
    echo $global_html || $has_html ? wpautop(wptexturize(wp_kses_post($seller_info))) : sanitize_text_field($seller_info);
    echo '<p>';
    echo '<a href="' . WCV_Vendors::get_vendor_shop_page($author) . '" class="button alt">' . sprintf(__('Visit &quot;%s&quot; Shop', 'tokopress'), $shop_name) . '</a>';
    echo '<a href="' . get_author_posts_url($author) . '#contact-form" class="button alt">' . __('Contact this seller', 'tokopress') . '</a>';
    echo '</p>';
    echo '</div>';
}
 public static function template_loop_sold_by($product_id)
 {
     $vendor_id = WCV_Vendors::get_vendor_from_product($product_id);
     $sold_by_label = WC_Vendors::$pv_options->get_option('sold_by_label');
     $sold_by = WCV_Vendors::is_vendor($vendor_id) ? sprintf('<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page($vendor_id), WCV_Vendors::get_vendor_sold_by($vendor_id)) : get_bloginfo('name');
     echo '<small class="wcvendors_sold_by_in_loop">' . apply_filters('wcvendors_sold_by_in_loop', $sold_by_label) . '&nbsp;' . $sold_by . '</small> <br />';
 }
 /**
  * Product's commission rate in percentage form
  *
  * Eg: 50 for 50%
  *
  * @param int $product_id
  *
  * @return float
  */
 public static function get_commission_rate($product_id)
 {
     $commission = 0;
     $parent = get_post_ancestors($product_id);
     if ($parent) {
         $product_id = $parent[0];
     }
     $vendor_id = WCV_Vendors::get_vendor_from_product($product_id);
     $product_commission = get_post_meta($product_id, 'pv_commission_rate', true);
     $vendor_commission = WCV_Vendors::get_default_commission($vendor_id);
     $default_commission = WC_Vendors::$pv_options->get_option('default_commission');
     if ($product_commission != '' && $product_commission !== false) {
         $commission = $product_commission;
     } else {
         if ($vendor_commission != '' && $vendor_commission !== false) {
             $commission = $vendor_commission;
         } else {
             if ($default_commission != '' && $default_commission !== false) {
                 $commission = $default_commission;
             }
         }
     }
     return apply_filters('wcv_commission_rate_percent', $commission, $product_id);
 }
 /**
  *
  *
  * @param unknown $items
  * @param unknown $order
  *
  * @return unknown
  */
 function check_items($items, $order)
 {
     foreach ($items as $key => $product) {
         //  If this is a line item
         if ($product['type'] == 'line_item') {
             $author = WCV_Vendors::get_vendor_from_product($product['product_id']);
             if ($this->current_vendor != $author) {
                 unset($items[$key]);
                 continue;
             } else {
                 $commission_due = WCV_Commission::calculate_commission($product['line_subtotal'], $product['product_id'], $order);
                 $items[$key]['line_subtotal'] = $commission_due;
                 $items[$key]['line_total'] = $commission_due;
                 // Don't display tax if give tax is not enabled.
                 // if ( !WC_Vendors::$pv_options->get_option( 'give_tax' ) ) {
                 // 	unset($items[ $key ][ 'line_tax' ]) ;
                 // }
             }
         }
     }
     return $items;
 }
Example #11
0
 public function template_loop_sold_by($product_id)
 {
     $author = WCV_Vendors::get_vendor_from_product($product_id);
     $sold_by = WCV_Vendors::is_vendor($author) ? sprintf('<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page($author), WCV_Vendors::get_vendor_shop_name($author)) : get_bloginfo('name');
     echo '<small>' . apply_filters('wcvendors_sold_by_in_loop', __('Sold by: ', 'wcvendors')) . $sold_by . '</small> <br />';
 }
 /**
  *
  *
  * @param unknown $items
  * @param unknown $order
  *
  * @return unknown
  */
 function check_items($items, $order)
 {
     $settings = get_option('woocommerce_vendor_new_order_settings');
     foreach ($items as $key => $product) {
         //  If this is a line item
         if ($product['type'] == 'line_item') {
             $author = WCV_Vendors::get_vendor_from_product($product['product_id']);
             if ($this->current_vendor != $author) {
                 unset($items[$key]);
                 continue;
             } else {
                 // If display commission is ticked show this otherwise show the full price.
                 if ('yes' == $settings['commission_display']) {
                     $commission_due = WCV_Commission::calculate_commission($product['line_subtotal'], $product['product_id'], $order, $product['qty']);
                     $items[$key]['line_subtotal'] = $commission_due;
                     $items[$key]['line_total'] = $commission_due;
                     // Don't display tax if give tax is not enabled.
                     if (!WC_Vendors::$pv_options->get_option('give_tax')) {
                         unset($items[$key]['line_tax']);
                     }
                 }
             }
         }
     }
     return $items;
 }
 private function get_vendor_id($product_id)
 {
     $author = WCV_Vendors::get_vendor_from_product($product_id);
     return $author;
 }
 /**
  *
  *
  * @param unknown $items
  * @param unknown $order
  *
  * @return unknown
  */
 function check_items($items, $order)
 {
     foreach ($items as $key => $product) {
         //  If this is a line item
         if ($product['type'] == 'line_item') {
             $author = WCV_Vendors::get_vendor_from_product($product['product_id']);
             if ($this->current_vendor != $author) {
                 unset($items[$key]);
                 continue;
             } else {
                 $commission_due = WCV_Commission::calculate_commission($product['line_subtotal'], $product['product_id'], $order);
                 $items[$key]['line_subtotal'] = $commission_due;
                 $items[$key]['line_total'] = $commission_due;
                 unset($items[$key]['line_tax']);
             }
         }
     }
     return $items;
 }
Example #15
0
    function mango_wc_vendor_header()
    {
        global $mango_settings, $post, $wp_query, $vendor_shop;
        $vendor_id = WCV_Vendors::get_vendor_id($vendor_shop);
        $shop_name = get_user_meta($vendor_id, 'pv_shop_name', true);
        $description = do_shortcode(get_user_meta($vendor_id, 'pv_shop_description', true));
        if ($vendor_shop) {
            if ($mango_settings['mango_wcvendors_shop_description']) {
                ?>
				 <?php 
                $product_id = get_the_ID();
                $author = WCV_Vendors::get_vendor_from_product($product_id);
                $link = WCV_Vendors::get_vendor_shop_page($author);
                $author = WCV_Vendors::get_vendor_from_product(get_the_ID());
                $user = get_userdata($author);
                ?>
					 
						<?php 
                $r = get_user_meta($user->ID, 'picture', true);
                $r = $r['url'];
                if ($r) {
                    ?>
						<div class="vendor-profile-bg" style="background:url('<?php 
                    echo $r;
                    ?>
') ;background-size:cover">
						<?php 
                } else {
                    ?>
						<div class="vendor-profile-bg">
						<?php 
                }
                ?>
						<div class="overlay-vendor-effect">
					<?php 
                if ($mango_settings['mango_wcvendors_shop_avatar']) {
                    ?>
					<div class="vendor_userimg">
				
					<div class="profile-img">
					  	<a href="<?php 
                    echo $link;
                    ?>
"> <?php 
                    echo get_avatar($vendor_id, 80);
                    ?>
</a>
					</div>
					
					</div>
					<?php 
                }
                ?>
					  <h1><a href="<?php 
                echo $link;
                ?>
"><?php 
                echo $shop_name;
                ?>
</a></h1>
					  <div class="custom_shop_description">
					  <?php 
                echo wpautop($description);
                ?>
					  </div>
				<?php 
                $author = WCV_Vendors::get_vendor_from_product(get_the_ID());
                $user = get_userdata($author);
                if ($mango_settings['mango_wcvendors_shop_profile']) {
                    ?>
				  
					 <?php 
                    if ($mango_settings['mango_wcvendors_phone']) {
                        if ($user->phone_number) {
                            ?>
				      <span class="vendorcustom-mail"><i class="fa fa-phone aligmentvendor"></i> &nbsp;<?php 
                            echo $user->phone_number;
                            ?>
</span>
				      <?php 
                        }
                    }
                    ?>
  &nbsp;&nbsp;
				    <?php 
                    if ($mango_settings['mango_wcvendors_email']) {
                        if ($user->user_email) {
                            ?>
				    <span class="vendorcustom-mail"><i class="fa fa-envelope aligmentvendor"></i> &nbsp;<?php 
                            echo $user->user_email;
                            ?>
</span>
				   <?php 
                        }
                    }
                    ?>
				   &nbsp;&nbsp;
					 <?php 
                    if ($mango_settings['mango_wcvendors_url']) {
                        if ($user->user_url) {
                            ?>
				    <span class="vendorcustom-mail"><i class="fa fa-globe aligmentvendor"></i> &nbsp; <?php 
                            echo $user->user_url;
                            ?>
</span>
				    <?php 
                        }
                    }
                    ?>

					<p class="vendor-user-social">
						<?php 
                    if ($user->facebook_url) {
                        ?>
							<span class="user-facebook"><a rel="nofollow" href="<?php 
                        echo esc_url($user->facebook_url);
                        ?>
"><i class="fa fa-facebook-square"></i></a></span>
						<?php 
                    }
                    ?>

						<?php 
                    if ($user->twitter_url) {
                        ?>
							<span class="user-twitter"><a rel="nofollow" href="<?php 
                        echo esc_url($user->twitter_url);
                        ?>
"><i class="fa fa-twitter-square"></i></a></span>
						<?php 
                    }
                    ?>

						<?php 
                    if ($user->gplus_url) {
                        ?>
							<span class="user-googleplus"><a rel="nofollow" href="<?php 
                        echo esc_url($user->gplus_url);
                        ?>
"><i class="fa fa-google-plus-square"></i></a></span>
						<?php 
                    }
                    ?>
						
						 <?php 
                    if ($user->youtube_url) {
                        ?>
							<span class="user-youtube"><a rel="nofollow" href="<?php 
                        echo esc_url($user->youtube_url);
                        ?>
"><i class="fa fa-youtube-square"></i></a></span>
						<?php 
                    }
                    ?>
						
							
						 <?php 
                    if ($user->linkedin_url) {
                        ?>
							<span class="user-linkedin"><a rel="nofollow" href="<?php 
                        echo esc_url($user->linkedin_url);
                        ?>
"><i class="fa fa-linkedin-square"></i></a></span>
						<?php 
                    }
                    ?>
						
						 <?php 
                    if ($user->flickr_url) {
                        ?>
							<span class="user-flicker"><a rel="nofollow" href="<?php 
                        echo esc_url($user->flickr_url);
                        ?>
"><i class="fa fa-flickr-square"></i></a></span>
						<?php 
                    }
                    ?>
						 
					</p>

				 <?php 
                }
                ?>
			 
				 </div>
				 </div>
				<?php 
            }
        }
        if (is_product()) {
            global $mango_settings, $post;
            $shop_name = get_user_meta($post->post_author, 'pv_shop_name', true);
            $Shop_description = get_user_meta($post->post_author, 'pv_shop_description', true);
            ?>

			 <?php 
            if ($mango_settings['mango_single_wcvendors_product_description']) {
                ?>
			   <?php 
                $product_id = get_the_ID();
                $author = WCV_Vendors::get_vendor_from_product($product_id);
                $link = WCV_Vendors::get_vendor_shop_page($author);
                $author = WCV_Vendors::get_vendor_from_product(get_the_ID());
                $user = get_userdata($author);
                ?>
					 
						<?php 
                $r = get_user_meta($user->ID, 'picture', true);
                $r = $r['url'];
                if ($r) {
                    ?>
						<div class="vendor-profile-bg" style="background:url('<?php 
                    echo $r;
                    ?>
') ;background-size:cover">
						<?php 
                } else {
                    ?>
						<div class="vendor-profile-bg">
						<?php 
                }
                ?>
						<div class="overlay-vendor-effect">
				 <?php 
                if ($mango_settings['mangowcvendors_product_avatar']) {
                    ?>
					<div class="vendor_userimg">
						
							<div class="profile-img">
						  <a href="<?php 
                    echo $link;
                    ?>
"> <?php 
                    echo get_avatar($author, 80);
                    ?>
	</a>
							</div>
					
					</div>
				 <?php 
                }
                ?>
				
			     <h1>
				  <a href="<?php 
                echo $link;
                ?>
"><?php 
                echo $shop_name;
                ?>
</a>
				 </h1>
				  <div class="custom_shop_description">
					<?php 
                echo wpautop($Shop_description);
                ?>
				  </div>
				<?php 
                $author = WCV_Vendors::get_vendor_from_product(get_the_ID());
                $user = get_userdata($author);
                if ($mango_settings['mango_wcvendors_product_profile']) {
                    ?>
			  
				 <?php 
                    if ($mango_settings['mango_wcvendors_phone']) {
                        if ($user->phone_number) {
                            ?>
					<span class="vendorcustom-mail"><i class="fa fa-phone aligmentvendor"></i> &nbsp;<?php 
                            echo $user->phone_number;
                            ?>
</span>
				<?php 
                        }
                    }
                    ?>
  
			    <?php 
                    if ($mango_settings['mango_wcvendors_email']) {
                        if ($user->user_email) {
                            ?>
			    <span class="vendorcustom-mail"><i class="fa fa-envelope aligmentvendor"></i> &nbsp;<?php 
                            echo $user->user_email;
                            ?>
</span>
			    <?php 
                        }
                    }
                    ?>
			  
				 <?php 
                    if ($mango_settings['mango_wcvendors_url']) {
                        if ($user->user_url) {
                            ?>
			     <span class="vendorcustom-mail"><i class="fa fa-globe  aligmentvendor"></i> &nbsp; <?php 
                            echo $user->user_url;
                            ?>
</span>
			    <?php 
                        }
                    }
                    ?>


	      	<p class="vendor-user-social">
				<?php 
                    if ($user->facebook_url) {
                        ?>
					<span class="user-facebook"><a rel="nofollow" href="<?php 
                        echo esc_url($user->facebook_url);
                        ?>
"><i class="fa fa-facebook-square"></i></a></span>
				<?php 
                    }
                    ?>

				<?php 
                    if ($user->twitter_url) {
                        ?>
					<span class="user-twitter"><a rel="nofollow" href="<?php 
                        echo esc_url($user->twitter_url);
                        ?>
"><i class="fa fa-twitter-square"></i></a></span>
				<?php 
                    }
                    ?>

				<?php 
                    if ($user->gplus_url) {
                        ?>
					<span class="user-googleplus"><a rel="nofollow" href="<?php 
                        echo esc_url($user->gplus_url);
                        ?>
"><i class="fa fa-google-plus-square"></i></a></span>
				<?php 
                    }
                    ?>
				
				 <?php 
                    if ($user->youtube_url) {
                        ?>
					<span class="user-youtube"><a rel="nofollow" href="<?php 
                        echo esc_url($user->youtube_url);
                        ?>
"><i class="fa fa-youtube-square"></i></a></span>
				<?php 
                    }
                    ?>
				
					
				 <?php 
                    if ($user->linkedin_url) {
                        ?>
					<span class="user-linkedin"><a rel="nofollow" href="<?php 
                        echo esc_url($user->linkedin_url);
                        ?>
"><i class="fa fa-linkedin-square"></i></a></span>
				<?php 
                    }
                    ?>
				
				 <?php 
                    if ($user->flickr_url) {
                        ?>
					<span class="user-flicker"><a rel="nofollow" href="<?php 
                        echo esc_url($user->flickr_url);
                        ?>
"><i class="fa fa-flickr-square"></i></a></span>
				<?php 
                    }
                    ?>
				 
				</p>	 
			 
				<?php 
                }
                ?>
			 
				 </div>
				 <?php 
            }
            ?>
					
				<?php 
        }
    }