本文整理汇总了PHP中WCV_Vendors::get_vendor_shop_page方法的典型用法代码示例。如果您正苦于以下问题:PHP WCV_Vendors::get_vendor_shop_page方法的具体用法?PHP WCV_Vendors::get_vendor_shop_page怎么用?PHP WCV_Vendors::get_vendor_shop_page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCV_Vendors
的用法示例。
在下文中一共展示了WCV_Vendors::get_vendor_shop_page方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sold_by_meta
/**
* Single product meta
*/
public static function sold_by_meta()
{
$vendor_id = get_the_author_meta('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" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page($vendor_id), WCV_Vendors::get_vendor_sold_by($vendor_id)) : get_bloginfo('name');
echo apply_filters('wcvendors_cart_sold_by_meta', $sold_by_label) . $sold_by . '<br/>';
}
示例2: show_vendor_in_email
/**
*
*
* @param unknown $name
* @param unknown $_product
*
* @return unknown
*/
function show_vendor_in_email($name, $_product)
{
$product = get_post($_product->id);
$sold_by = WCV_Vendors::is_vendor($product->post_author) ? sprintf('<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page($product->post_author), WCV_Vendors::get_vendor_sold_by($product->post_author)) : get_bloginfo('name');
$name .= '<small class="wcvendors_sold_by_in_email"><br />' . apply_filters('wcvendors_sold_by_in_email', __('Sold by: ', 'wcvendors')) . $sold_by . '</small><br />';
return $name;
}
示例3: filter_comment
public function filter_comment($commentdata, $order)
{
$user_id = get_current_user_id();
$commentdata['user_id'] = $user_id;
$commentdata['comment_author'] = WCV_Vendors::get_vendor_shop_name($user_id);
$commentdata['comment_author_url'] = WCV_Vendors::get_vendor_shop_page($user_id);
$commentdata['comment_author_email'] = wp_get_current_user()->user_email;
return $commentdata;
}
示例4: settings_page
function settings_page()
{
$user_id = get_current_user_id();
$paypal_address = true;
$shop_description = true;
$description = get_user_meta($user_id, 'pv_shop_description', true);
$seller_info = get_user_meta($user_id, 'pv_seller_info', true);
$has_html = get_user_meta($user_id, 'pv_shop_html_enabled', true);
$shop_page = WCV_Vendors::get_vendor_shop_page(wp_get_current_user()->user_login);
$global_html = WC_Vendors::$pv_options->get_option('shop_html_enabled');
include 'views/html-vendor-settings-page.php';
}
示例5: display_vendor_settings
/**
* [pv_recent_vendor_sales] shortcode
*
* @param array $atts
*
* @return unknown
*/
public function display_vendor_settings($atts)
{
global $woocommerce;
if (!$this->can_view_vendor_page()) {
return false;
}
extract(shortcode_atts(array('user_id' => get_current_user_id(), 'paypal_address' => true, 'shop_description' => true), $atts));
$description = get_user_meta($user_id, 'pv_shop_description', true);
$seller_info = get_user_meta($user_id, 'pv_seller_info', true);
$has_html = get_user_meta($user_id, 'pv_shop_html_enabled', true);
$shop_page = WCV_Vendors::get_vendor_shop_page(wp_get_current_user()->user_login);
$global_html = WC_Vendors::$pv_options->get_option('shop_html_enabled');
ob_start();
wc_get_template('settings.php', array('description' => $description, 'global_html' => $global_html, 'has_html' => $has_html, 'paypal_address' => $paypal_address, 'seller_info' => $seller_info, 'shop_description' => $shop_description, 'shop_page' => $shop_page, 'user_id' => $user_id), 'wc-vendors/dashboard/settings/', wcv_plugin_dir . 'templates/dashboard/settings/');
return ob_get_clean();
}
示例6: tokopress_wcvendors_user_vendorshop
function tokopress_wcvendors_user_vendorshop()
{
$user = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
if (WCV_Vendors::is_vendor($user->ID)) {
$shop_name = WCV_Vendors::get_vendor_shop_name($user->ID);
$shop_page = WCV_Vendors::get_vendor_shop_page($user->user_login);
if ($shop_name && $shop_page) {
echo '<div class="user-vendorshop">';
echo '<p>' . sprintf(__('%s is a seller on "%s" shop.', 'tokopress'), '<strong>' . $user->display_name . '</strong>', $shop_name) . '</p>';
echo '<a href="' . $shop_page . '" class="button alt">' . sprintf(__('Visit "%s"', 'tokopress'), $shop_name) . '</a>';
echo '</div>';
}
}
}
示例7: template_loop_sold_by
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) . ' ' . $sold_by . '</small> <br />';
}
示例8: template_loop_sold_by
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 />';
}
示例9: tpvc_wc_mini_wcvendors_shortcode
//.........这里部分代码省略.........
// 'order' => $tpvc_wc_vendor_order,
// );
// if ($tpvc_wc_vendor_show_products == 'yes') $vendor_total_args['query_id'] = 'vendors_with_products';
// $vendor_query = New WP_User_Query( $vendor_total_args );
// $all_vendors =$vendor_query->get_results();
// Get the paged vendors
$vendor_paged_args = array('role' => 'vendor', 'meta_key' => 'pv_shop_slug', 'meta_value' => '', 'meta_compare' => '>', 'orderby' => $tpvc_wc_vendor_orderby, 'order' => $tpvc_wc_vendor_order, 'offset' => $offset, 'number' => $tpvc_wc_vendor_numbers);
if ($tpvc_wc_vendor_show_products == 'yes') {
$vendor_total_args['query_id'] = 'vendors_with_products';
}
$vendor_paged_query = new WP_User_Query($vendor_paged_args);
$paged_vendors = $vendor_paged_query->get_results();
// Pagination calcs
// $total_vendors = count($all_vendors);
// $total_vendors_paged = count($paged_vendors);
// $total_pages = intval($total_vendors / $per_page) + 1;
ob_start();
if (!empty($paged_vendors)) {
?>
<div class="tpvc-mini-product woocommerce <?php
echo $tpvc_wc_vendor_class;
?>
">
<?php
if ("hide" != $tpvc_wc_vendor_hide_title) {
?>
<div class="tpvc-title" <?php
if ("" !== $tpvc_wc_vendor_title_bg) {
echo 'style="background-color:' . $tpvc_wc_vendor_title_bg . '"';
}
?>
>
<h2 <?php
if ("" !== $tpvc_wc_vendor_title_color) {
echo 'style="color:' . $tpvc_wc_vendor_title_color . '"';
}
?>
>
<?php
if ("" != $tpvc_wc_vendor_title_icon) {
echo '<i class="' . tpvc_icon($tpvc_wc_vendor_title_icon) . '" ' . ($tpvc_wc_vendor_title_icon_color ? 'style="color:' . $tpvc_wc_vendor_title_icon_color . '"' : '') . '></i>';
}
?>
<?php
echo $tpvc_wc_vendor_title;
?>
</h2>
</div>
<?php
}
?>
<ul class="products">
<?php
foreach ($paged_vendors as $vendor) {
?>
<?php
$vendor_link = WCV_Vendors::get_vendor_shop_page($vendor->ID);
?>
<?php
$vendor_name = $vendor->pv_shop_name;
?>
<li class="product">
<?php
echo get_avatar($vendor->ID, 200);
?>
<div class="mini-icon-view">
<a href="<?php
echo esc_url($vendor_link);
?>
" title="<?php
echo esc_attr($vendor_name);
?>
">
<i class="fa fa-search"></i>
</a>
</div>
</li>
<?php
}
// end of the loop.
?>
</ul>
</div>
<?php
}
return ob_get_clean();
}
示例10: get_permalink
echo get_permalink($dashboard_id);
?>
">
<?php
_e('My Dashboard', 'mango');
?>
<i class="icon-speedometer"></i>
</a>
</li>
<?php
}
?>
<li>
<a rel="nofollow" href="<?php
echo WCV_Vendors::get_vendor_shop_page(wp_get_current_user()->user_login);
?>
">
<?php
_e('My Shop', 'mango');
?>
<i class="icon-bag"></i>
</a>
</li>
<?php
if ($settings_id = WC_Vendors::$pv_options->get_option('shop_settings_page')) {
?>
<li>
<a rel="nofollow" href="<?php
echo get_permalink($settings_id);
?>
示例11: wcv_vendorslist
/**
* list of vendors
*
* @param $atts shortcode attributs
*/
public function wcv_vendorslist($atts)
{
$html = '';
extract(shortcode_atts(array('orderby' => 'registered', 'order' => 'ASC', 'per_page' => '12', 'columns' => '4', 'show_products' => 'yes'), $atts));
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$offset = ($paged - 1) * $per_page;
// Hook into the user query to modify the query to return users that have at least one product
if ($show_products == 'yes') {
add_action('pre_user_query', array($this, 'vendors_with_products'));
}
// Get all vendors
$vendor_total_args = array('role' => 'vendor', 'meta_key' => 'pv_shop_slug', 'meta_value' => '', 'meta_compare' => '>', 'orderby' => $orderby, 'order' => $order);
if ($show_products == 'yes') {
$vendor_total_args['query_id'] = 'vendors_with_products';
}
$vendor_query = new WP_User_Query($vendor_total_args);
$all_vendors = $vendor_query->get_results();
// Get the paged vendors
$vendor_paged_args = array('role' => 'vendor', 'meta_key' => 'pv_shop_slug', 'meta_value' => '', 'meta_compare' => '>', 'orderby' => $orderby, 'order' => $order, 'offset' => $offset, 'number' => $per_page);
if ($show_products == 'yes') {
$vendor_paged_args['query_id'] = 'vendors_with_products';
}
$vendor_paged_query = new WP_User_Query($vendor_paged_args);
$paged_vendors = $vendor_paged_query->get_results();
// Pagination calcs
$total_vendors = count($all_vendors);
$total_vendors_paged = count($paged_vendors);
$total_pages = ceil($total_vendors / $per_page);
ob_start();
// Loop through all vendors and output a simple link to their vendor pages
foreach ($paged_vendors as $vendor) {
wc_get_template('vendor-list.php', array('shop_link' => WCV_Vendors::get_vendor_shop_page($vendor->ID), 'shop_name' => $vendor->pv_shop_name, 'vendor_id' => $vendor->ID, 'shop_description' => $vendor->pv_shop_description), 'wc-vendors/front/', wcv_plugin_dir . 'templates/front/');
}
// End foreach
$html .= '<ul class="wcv_vendorslist">' . ob_get_clean() . '</ul>';
if ($total_vendors > $total_vendors_paged) {
$html .= '<div class="wcv_pagination">';
$current_page = max(1, get_query_var('paged'));
$html .= paginate_links(array('base' => get_pagenum_link() . '%_%', 'format' => 'page/%#%/', 'current' => $current_page, 'total' => $total_pages, 'prev_next' => false, 'type' => 'list'));
$html .= '</div>';
}
return $html;
}
示例12: mango_wc_vendors_sold_by_meta
function mango_wc_vendors_sold_by_meta()
{
global $mango_settings;
$author_id = get_the_author_meta('ID');
$vendor_display_name = WC_Vendors::$pv_options->get_option('vendor_display_name');
switch ($vendor_display_name) {
case 'display_name':
$vendor = get_userdata($author_id);
$vendor_name = $vendor->display_name;
break;
case 'user_login':
$vendor = get_userdata($author_id);
$vendor_name = $vendor->user_login;
break;
default:
$vendor_name = WCV_Vendors::get_vendor_shop_name($author_id);
break;
}
$sold_by = WCV_Vendors::is_vendor($author_id) ? sprintf('<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page($author_id), $vendor_name) : get_bloginfo('name');
if ($mango_settings['mango_wcvendors_product_soldby']) {
echo '<ul class="list-item-details"><li><span class="data-type">' . __('Sold by : ', 'mango') . '</span><span class="value">' . $sold_by . '</span></li></ul>';
}
}
示例13: mango_wc_vendor_header
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> <?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> <?php
echo $user->user_email;
?>
</span>
<?php
}
}
?>
<?php
if ($mango_settings['mango_wcvendors_url']) {
if ($user->user_url) {
//.........这里部分代码省略.........
示例14: sold_by_meta
/**
*
*/
public static function sold_by_meta()
{
$author_id = get_the_author_meta('ID');
$sold_by = WCV_Vendors::is_vendor($author_id) ? sprintf('<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page($author_id), WCV_Vendors::get_vendor_shop_name($author_id)) : get_bloginfo('name');
echo apply_filters('wcvendors_cart_sold_by_meta', __('Sold by: ', 'wcvendors')) . $sold_by . '<br/>';
}