当前位置: 首页>>代码示例>>PHP>>正文


PHP dokan_get_store_url函数代码示例

本文整理汇总了PHP中dokan_get_store_url函数的典型用法代码示例。如果您正苦于以下问题:PHP dokan_get_store_url函数的具体用法?PHP dokan_get_store_url怎么用?PHP dokan_get_store_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dokan_get_store_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store_listing

/**
 * Displays the store lists
 *
 * @since 2.4
 *
 * @param  array $atts
 *
 * @return string
 */
function store_listing($atts)
{
    global $post;
    /**
     * Filter return the number of store listing number per page.
     *
     * @since 2.2
     *
     * @param array
     */
    $attr = shortcode_atts(apply_filters('dokan_store_listing_per_page', array('per_page' => 10)), $atts);
    $paged = max(1, get_query_var('paged'));
    $limit = $attr['per_page'];
    $offset = ($paged - 1) * $limit;
    $sellers = dokan_get_sellers($limit, $offset);
    ob_start();
    if ($sellers['users']) {
        ?>
    <ul class="dokan-seller-wrap">
        <?php 
        foreach ($sellers['users'] as $seller) {
            $store_info = dokan_get_store_info($seller->ID);
            $banner_id = isset($store_info['banner']) ? $store_info['banner'] : 0;
            $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
            $store_url = dokan_get_store_url($seller->ID);
            ?>

            <li class="dokan-single-seller">
                <div class="dokan-store-thumbnail">

                    <a href="<?php 
            echo $store_url;
            ?>
">
                        <?php 
            if ($banner_id) {
                $banner_url = wp_get_attachment_image_src($banner_id, 'medium');
                ?>
                            <img class="dokan-store-img" src="<?php 
                echo esc_url($banner_url[0]);
                ?>
" alt="<?php 
                echo esc_attr($store_name);
                ?>
">
                        <?php 
            } else {
                ?>
                            <img class="dokan-store-img" src="<?php 
                echo dokan_get_no_seller_image();
                ?>
" alt="<?php 
                _e('No Image', 'dokan');
                ?>
">
                        <?php 
            }
            ?>
                    </a>

                    <div class="dokan-store-caption">
                        <h3><a href="<?php 
            echo $store_url;
            ?>
"><?php 
            echo $store_name;
            ?>
</a></h3>

                        <address>

                            <?php 
            if (isset($store_info['address']) && !empty($store_info['address'])) {
                echo dokan_get_seller_address($seller->ID);
            }
            ?>

                            <?php 
            if (isset($store_info['phone']) && !empty($store_info['phone'])) {
                ?>
                                <br>
                                <abbr title="<?php 
                _e('Phone Number', 'dokan');
                ?>
"><?php 
                _e('P:', 'dokan');
                ?>
</abbr> <?php 
                echo esc_html($store_info['phone']);
                ?>
                            <?php 
//.........这里部分代码省略.........
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:101,代码来源:template-tags.php

示例2: get_portfolio_button

 function get_portfolio_button()
 {
     $button_text = __('View Portfolio', 'artgorae');
     $button_icon = 'fa fa-pencil-square-o';
     $button_text_html = $this->get_text_with_icon($button_text, $button_icon);
     $button_class = 'button';
     $button_link = dokan_get_store_url(get_the_author_meta('ID')) . 'toc';
     echo $this->get_anchor_button($button_link, $button_class, $button_text_html);
 }
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:9,代码来源:marketica-seller-info.php

示例3: store_page_breadcrumb

 /**
  * Generate breadcrumb for store page
  * 
  * @since 2.4.7
  * 
  * @param array $crumbs
  * 
  * @return array $crumbs
  */
 public function store_page_breadcrumb($crumbs)
 {
     if (dokan_is_store_page()) {
         $author = get_query_var($this->custom_store_url);
         $seller_info = get_user_by('slug', $author);
         $crumbs[1] = array(ucwords($this->custom_store_url), site_url() . '/' . $this->custom_store_url);
         $crumbs[2] = array($author, dokan_get_store_url($seller_info->data->ID));
     }
     return $crumbs;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:19,代码来源:rewrites.php

示例4: widget

    /**
     * Outputs the HTML for this widget.
     *
     * @param array  An array of standard parameters for widgets in this theme
     * @param array  An array of settings for this widget instance
     * @return void Echoes it's output
     **/
    function widget($args, $instance)
    {
        global $wpdb;
        extract($args, EXTR_SKIP);
        $title = apply_filters('widget_title', $instance['title']);
        $limit = absint($instance['count']) ? absint($instance['count']) : 10;
        $cache_key = 'dokan-best-seller-' . $limit;
        $seller = wp_cache_get($cache_key, 'widget');
        if (false === $seller) {
            $qry = "SELECT seller_id, display_name,SUM( net_amount ) AS total_sell\r\n                FROM {$wpdb->prefix}dokan_orders AS o,{$wpdb->prefix}users AS u\r\n                WHERE o.seller_id = u.ID\r\n                GROUP BY o.seller_id\r\n                ORDER BY total_sell DESC LIMIT " . $limit;
            $seller = $wpdb->get_results($qry);
            wp_cache_set($cache_key, $seller, 'widget');
        }
        echo $before_widget;
        if (!empty($title)) {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        ?>
            <ul> 
                <?php 
        if ($seller) {
            foreach ($seller as $key => $value) {
                $rating = dokan_get_seller_rating($value->seller_id);
                $display_rating = $rating['rating'];
                if (!$rating['count']) {
                    $display_rating = 'No ratings found yet!';
                }
                ?>
                        <li>
                            <a href="<?php 
                echo dokan_get_store_url($value->seller_id);
                ?>
">
                                <?php 
                echo $value->display_name;
                ?>
                            </a><br />
                            <i class='fa fa-star'></i> 
                            <?php 
                echo $display_rating;
                ?>
                        </li>

                        <?php 
            }
        }
        ?>
            </ul>
        <?php 
        echo $after_widget;
    }
开发者ID:uwitec,项目名称:findgreatmaster,代码行数:58,代码来源:best-seller.php

示例5: widget

    /**
     * Outputs the HTML for this widget.
     *
     * @param array  An array of standard parameters for widgets in this theme
     * @param array  An array of settings for this widget instance
     * @return void Echoes it's output
     **/
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $title = apply_filters('widget_title', $instance['title']);
        $limit = absint($instance['count']) ? absint($instance['count']) : 10;
        $sellers = dokan_get_feature_sellers($limit);
        echo $before_widget;
        if (!empty($title)) {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        ?>
        <ul class="dokan-feature-sellers">
            <?php 
        if ($sellers) {
            foreach ($sellers as $key => $seller) {
                $store_info = dokan_get_store_info($seller->ID);
                $rating = dokan_get_seller_rating($seller->ID);
                $display_rating = $rating['rating'];
                if (!$rating['count']) {
                    $display_rating = __('No ratings found yet!', 'dokan');
                }
                ?>
                    <li>
                        <a href="<?php 
                echo dokan_get_store_url($seller->ID);
                ?>
">
                            <?php 
                echo esc_html($store_info['store_name']);
                ?>
                        </a><br />
                        <i class='fa fa-star'></i>
                        <?php 
                echo $display_rating;
                ?>
                    </li>

                    <?php 
            }
        }
        ?>
        </ul>
        <?php 
        echo $after_widget;
    }
开发者ID:abcode619,项目名称:wpstuff,代码行数:52,代码来源:feature-seller.php

示例6: dokan_send_notification_to_users

/**
 * Send notification to the users when a product is published by seller
 *
 * @param WP_Post $post
 * @return void
 */
function dokan_send_notification_to_users($post)
{
    $prefix = FARMTOYOU_META_PREFIX;
    if ($post->post_type != 'product') {
        return;
    }
    $seller = get_user_by('id', $post->post_author);
    $product = get_product($post->ID);
    $dokan_email = new Dokan_Email();
    $args = array('post_type' => FARMTOYOU_NEWSLETTER_POST_TYPE, 'post_status' => 'active', 'posts_per_page' => '-1', 'meta_query' => array(array('key' => $prefix . 'post_author', 'value' => $seller->ID)));
    //get newsletter data from database
    $all_newsletter = get_posts($args);
    foreach ($all_newsletter as $value) {
        $category = wp_get_post_terms($product->id, 'product_cat', array('fields' => 'names'));
        $category_name = $category ? reset($category) : 'N/A';
        $user_id = get_post_meta($value->ID, $prefix . 'curr_user_id', true);
        $user_info = get_userdata($user_id);
        $first_name = $user_info->first_name;
        $last_name = $user_info->last_name;
        $param = array('vendor_id' => base64_encode($seller->ID), 'user_id' => base64_encode($user_id), 'status' => base64_encode('pending'));
        $unsubscribe_link = add_query_arg($param, site_url());
        $users_email = get_post_meta($value->ID, $prefix . 'post_title', true);
        $body = "Hello {$first_name} {$last_name}," . "\r\n\n";
        $body .= "A new product has been submitted to site (" . home_url() . ")\r\n\n";
        $body .= "Summary of the product:" . "\r\n";
        $body .= "------------------------" . "\r\n\n";
        $body .= "Title: " . $product->get_title() . "\r\n";
        $body .= "Price: " . $dokan_email->currency_symbol($product->get_price()) . "\r\n";
        $body .= "Seller: " . $seller->display_name . " (" . dokan_get_store_url($seller->ID) . ")\r\n";
        $body .= "Category: " . $category_name . "\r\n\n";
        $body .= "Currently you are active user of site. <a href='" . $unsubscribe_link . "'>Click here to unsubscribe</a>";
        $subject = sprintf(__('[%s] New Product Added', 'dokan'), $dokan_email->get_from_name());
        $headers = array('Content-Type: text/html; charset=UTF-8');
        $dokan_email->send($users_email, $subject, nl2br($body), $headers);
    }
}
开发者ID:abcode619,项目名称:wpstuff,代码行数:42,代码来源:dokan-custom-email.php

示例7: isset

                            <?php 
        echo isset($statuses[$order->post_status]) ? $statuses[$order->post_status] : $order->post_status;
        ?>
                        </td>
                        <td class="order-total">
                            <?php 
        echo sprintf(_n('%s for %s item', '%s for %s items', $item_count, 'dokan'), $order->get_formatted_order_total(), $item_count);
        ?>
                        </td>
                        
                        <td class="order-total">
                            <?php 
        $seller_id = dokan_get_seller_id_by_order($order->id);
        if ($seller_id && $seller_id != 0) {
            $sellershop = dokan_get_store_info($seller_id);
            echo '<a href="' . dokan_get_store_url($seller_id) . '">' . $sellershop['store_name'] . '</a>';
        } else {
            _e('Multiple Seller', 'dokan');
        }
        ?>
                        </td>

                        <td class="order-actions">
                            <?php 
        $actions = array();
        if (in_array($order->status, apply_filters('woocommerce_valid_order_statuses_for_payment', array('pending', 'failed'), $order))) {
            $actions['pay'] = array('url' => $order->get_checkout_payment_url(), 'name' => __('Pay', 'dokan'));
        }
        if (in_array($order->status, apply_filters('woocommerce_valid_order_statuses_for_cancel', array('pending', 'failed'), $order))) {
            $actions['cancel'] = array('url' => $order->get_cancel_order_url(get_permalink(wc_get_page_id('myaccount'))), 'name' => __('Cancel', 'dokan'));
        }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:31,代码来源:my-orders.php

示例8: review_pagination

 /**
  * Review Pagination
  *
  * @since 2.4
  *
  * @param int     $id
  * @param string  $post_type
  * @param int     $limit
  * @param string  $status
  *
  * @return string
  */
 function review_pagination($id, $post_type, $limit, $status)
 {
     global $wpdb;
     // $status = $this->page_status();
     if ($status == '1') {
         $query = "{$wpdb->comments}.comment_approved IN ('1','0') AND";
     } else {
         $query = "{$wpdb->comments}.comment_approved='{$status}' AND";
     }
     $total = $wpdb->get_var("SELECT COUNT(*)\n            FROM {$wpdb->comments}, {$wpdb->posts}\n            WHERE   {$wpdb->posts}.post_author='{$id}' AND\n            {$wpdb->posts}.post_status='publish' AND\n            {$wpdb->comments}.comment_post_ID={$wpdb->posts}.ID AND\n            {$query}\n            {$wpdb->posts}.post_type='{$post_type}'");
     $pagenum = max(get_query_var('paged'), 1);
     $num_of_pages = ceil($total / $limit);
     $page_links = paginate_links(array('base' => dokan_get_store_url($id) . 'reviews/%_%', 'format' => 'page/%#%', 'prev_text' => __('&laquo;', 'aag'), 'next_text' => __('&raquo;', 'aag'), 'total' => $num_of_pages, 'type' => 'array', 'current' => $pagenum));
     if ($page_links) {
         $pagination_links = '<div class="pagination-wrap">';
         $pagination_links .= '<ul class="pagination"><li>';
         $pagination_links .= join("</li>\n\t<li>", $page_links);
         $pagination_links .= "</li>\n</ul>\n";
         $pagination_links .= '</div>';
         return $pagination_links;
     }
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:34,代码来源:reviews.php

示例9: dokan_product_seller_tab

/**
 * Prints seller info in product single page
 *
 * @global WC_Product $product
 * @param type $val
 */
function dokan_product_seller_tab($val)
{
    global $product;
    $author = get_user_by('id', $product->post->post_author);
    $store_info = dokan_get_store_info($author->ID);
    ?>
    <h2><?php 
    _e('Seller Information', 'dokan');
    ?>
</h2>
    <ul class="list-unstyled">

        <?php 
    if (!empty($store_info['store_name'])) {
        ?>
            <li class="store-name">
                <span><?php 
        _e('Store Name:', 'dokan');
        ?>
</span>
                <span class="details">
                    <?php 
        echo esc_html($store_info['store_name']);
        ?>
                </span>
            </li>
        <?php 
    }
    ?>

        <li class="seller-name">
            <span>
                <?php 
    _e('Seller:', 'dokan');
    ?>
            </span>

            <span class="details">
                <?php 
    printf('<a href="%s">%s</a>', dokan_get_store_url($author->ID), $author->display_name);
    ?>
            </span>
        </li>
        <?php 
    if (!empty($store_info['address'])) {
        ?>
            <li class="store-address">
                <span><?php 
        _e('Address:', 'dokan');
        ?>
</span>
                <span class="details">
                    <?php 
        echo esc_html($store_info['address']);
        ?>
                </span>
            </li>
        <?php 
    }
    ?>

        <li class="clearfix">
            <?php 
    dokan_get_readable_seller_rating($author->ID);
    ?>
        </li>
    </ul>

    <?php 
}
开发者ID:abcode619,项目名称:wpstuff,代码行数:76,代码来源:wc-template.php

示例10: foreach

?>

<ul class="dokan-best-sellers">
    <?php 
if ($seller) {
    foreach ($seller as $key => $value) {
        $store_info = dokan_get_store_info($value->seller_id);
        $rating = dokan_get_seller_rating($value->seller_id);
        $display_rating = $rating['rating'];
        if (!$rating['count']) {
            $display_rating = __('No ratings found yet!', 'dokan');
        }
        ?>
            <li>
                <a href="<?php 
        echo dokan_get_store_url($value->seller_id);
        ?>
">
                    <?php 
        echo esc_html($store_info['store_name']);
        ?>
                </a><br />
                <i class='fa fa-star'></i>
                <?php 
        echo $display_rating;
        ?>
            </li>
            <?php 
    }
} else {
    ?>
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:31,代码来源:best-seller.php

示例11: __construct

 function __construct($seller_id)
 {
     $this->store_url = dokan_get_store_url($seller_id);
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:4,代码来源:store-menu-category.php

示例12: dokan_header_user_menu

    /**
     * User top navigation menu
     *
     * @return void
     */
    function dokan_header_user_menu()
    {
        ?>
    <ul class="nav navbar-nav navbar-right">
        <li>
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php 
        printf(__('Cart %s', 'dokan'), '<span class="dokan-cart-amount-top">(' . WC()->cart->get_cart_total() . ')</span>');
        ?>
 <b class="caret"></b></a>

            <ul class="dropdown-menu">
                <li>
                    <div class="widget_shopping_cart_content"></div>
                </li>
            </ul>
        </li>

        <?php 
        if (is_user_logged_in()) {
            ?>

            <?php 
            global $current_user;
            $user_id = $current_user->ID;
            if (dokan_is_user_seller($user_id)) {
                ?>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php 
                _e('Seller Dashboard', 'dokan');
                ?>
 <b class="caret"></b></a>

                    <ul class="dropdown-menu">
                        <li><a href="<?php 
                echo dokan_get_store_url($user_id);
                ?>
" target="_blank"><?php 
                _e('Visit your store', 'dokan');
                ?>
 <i class="fa fa-external-link"></i></a></li>
                        <li class="divider"></li>
                        <?php 
                $nav_urls = dokan_get_dashboard_nav();
                foreach ($nav_urls as $key => $item) {
                    printf('<li><a href="%s">%s &nbsp;%s</a></li>', $item['url'], $item['icon'], $item['title']);
                }
                ?>
                    </ul>
                </li>
            <?php 
            }
            ?>

            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php 
            echo esc_html($current_user->display_name);
            ?>
 <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="<?php 
            echo dokan_get_page_url('my_orders');
            ?>
"><?php 
            _e('My Orders', 'dokan');
            ?>
</a></li>
                    <li><a href="<?php 
            echo dokan_get_page_url('myaccount', 'woocommerce');
            ?>
"><?php 
            _e('My Account', 'dokan');
            ?>
</a></li>
                    <li><a href="<?php 
            echo wc_customer_edit_account_url();
            ?>
"><?php 
            _e('Edit Account', 'dokan');
            ?>
</a></li>
                    <li class="divider"></li>
                    <li><a href="<?php 
            echo wc_get_endpoint_url('edit-address', 'billing', get_permalink(wc_get_page_id('myaccount')));
            ?>
"><?php 
            _e('Billing Address', 'dokan');
            ?>
</a></li>
                    <li><a href="<?php 
            echo wc_get_endpoint_url('edit-address', 'shipping', get_permalink(wc_get_page_id('myaccount')));
            ?>
"><?php 
            _e('Shipping Address', 'dokan');
            ?>
</a></li>
//.........这里部分代码省略.........
开发者ID:abcode619,项目名称:wpstuff,代码行数:101,代码来源:template-tags.php

示例13: farmtoyou_seller_rating_review

/**
 * Call function for seller ratings and reviews
 */
function farmtoyou_seller_rating_review()
{
    if (!empty($_POST['rating']) && !empty($_POST['comment'])) {
        $prefix = FARMTOYOU_META_PREFIX;
        $current_user = wp_get_current_user();
        $seller_id = $_POST['seller_id'];
        $seller_rating = $_POST['rating'];
        $user_comment = $_POST['comment'];
        $seller_post = array('post_type' => FARMTOYOU_SELLER_REVIEW_POST_TYPE, 'post_status' => 'pending');
        $last_id = wp_insert_post($seller_post);
        update_post_meta($last_id, $prefix . 'seller_id', $seller_id);
        update_post_meta($last_id, $prefix . 'seller_rating', $seller_rating);
        update_post_meta($last_id, $prefix . 'user_comment', $user_comment);
        update_post_meta($last_id, $prefix . 'current_user_id', $current_user->ID);
        $store_url = dokan_get_store_url($seller_id);
        wp_redirect($store_url);
        exit;
    }
}
开发者ID:abcode619,项目名称:wpstuff,代码行数:22,代码来源:custom-functions.php

示例14: dokan_get_review_url

/**
 * Get review page url of a seller
 *
 * @param int $user_id
 * @return string
 */
function dokan_get_review_url($user_id)
{
    $userstore = dokan_get_store_url($user_id);
    return $userstore . "reviews";
}
开发者ID:uwitec,项目名称:findgreatmaster,代码行数:11,代码来源:theme-functions.php

示例15: do_action

 * @hooked woocommerce_template_single_sharing - 50
 */
do_action('woocommerce_single_product_summary');
?>

	</div><!-- .summary -->
	<?php 
/*This coustomization was created by TOWHID	*/
global $product;
$author = get_user_by('id', $product->post->post_author);
$store_info = dokan_get_store_info($author->ID);
if (!empty($store_info['store_name'])) {
    ?>
                <span class="seller_name">
                    <p>Seller Name: <?php 
    printf('<a href="%s">%s</a>', dokan_get_store_url($author->ID), $author->display_name);
    ?>
</p>
                	<p>Seller Phone: <?php 
    echo $store_info['phone'];
    ?>
</p>
                </span>
 		<?php 
}
?>
	<?php 
/**
 * woocommerce_after_single_product_summary hook
 *
 * @hooked woocommerce_output_product_data_tabs - 10
开发者ID:nayemDevs,项目名称:woocommerce-content-single-product,代码行数:31,代码来源:content-single-product.php


注:本文中的dokan_get_store_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。