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


PHP dokan_get_store_info函数代码示例

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


在下文中一共展示了dokan_get_store_info函数的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: 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);
    dokan_get_template_part('global/product-tab', '', array('author' => $author, 'store_info' => $store_info));
}
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:13,代码来源:wc-template.php

示例3: display_newsletter

 /**
  * Displaying Prodcuts
  *
  * Does prepare the data for displaying the products in the table.
  */
 function display_newsletter()
 {
     $data = array();
     $prefix = FARMTOYOU_META_PREFIX;
     //if search is call then pass searching value to function for displaying searching values
     $args = array('post_type' => FARMTOYOU_NEWSLETTER_POST_TYPE, 'post_status' => 'any', 'posts_per_page' => '-1');
     //get newsletter data from database
     $all_newsletter = get_posts($args);
     foreach ($all_newsletter as $key => $value) {
         $seller_id = get_post_meta($value->ID, $prefix . 'post_author', true);
         $store_info = dokan_get_store_info($seller_id);
         $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
         $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;
         $data[$key]['ID'] = isset($value->ID) ? $value->ID : '';
         $data[$key]['post_author'] = $store_name;
         $data[$key]['post_email'] = get_post_meta($value->ID, $prefix . 'post_title', true);
         $data[$key]['user_name'] = $first_name . " " . $last_name;
         $data[$key]['post_status'] = isset($value->post_status) && $value->post_status == 'publish' ? 'Active' : 'Inactive';
         $data[$key]['post_date'] = isset($value->post_date) ? $value->post_date : '';
     }
     return $data;
 }
开发者ID:abcode619,项目名称:wpstuff,代码行数:30,代码来源:newsletter-page.php

示例4: upgrade_store_meta_23

/**
 * Upgrade store meta for sellers
 * and replace old address meta with new address meta
 *
 * @since 2.3
 *
 * @return void
 */
function upgrade_store_meta_23()
{
    $query = new WP_User_Query(array('role' => 'seller'));
    $sellers = $query->get_results();
    $default_settings = array('store_name' => '', 'location' => '', 'find_address' => '', 'banner' => '', 'phone' => '', 'show_email' => '', 'gravatar' => '', 'payment' => array(), 'social' => array());
    foreach ($sellers as $seller) {
        $current_settings = dokan_get_store_info($seller->ID);
        $current_settings = wp_parse_args($current_settings, $default_settings);
        $old_address = $current_settings['address'];
        $new_address = array('street_1' => $old_address, 'street_2' => '', 'city' => '', 'zip' => '', 'country' => '', 'state' => '');
        $current_settings['address'] = $new_address;
        update_user_meta($seller->ID, 'dokan_profile_settings', $current_settings);
    }
}
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:22,代码来源:dokan-upgrade-2.3.php

示例5: add_checkout_options

function add_checkout_options()
{
    global $woocommerce;
    $vendor_ids = array();
    foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
        if (!in_array($cart_item['data']->post->post_author, $vendor_ids)) {
            $vendor_ids[] = $cart_item['data']->post->post_author;
        }
    }
    ?>
        <div class="your-order">
            <?php 
    foreach ($vendor_ids as $vendor_id) {
        $store_settings = dokan_get_store_info($vendor_id);
        $shipping_charge = get_user_meta($vendor_id, 'dokan_enable_seller_shipping', true);
        $seller_shipping_charge = get_user_meta($vendor_id, 'dokan_seller_shipping_charge', true);
        $currency_symbol = get_woocommerce_currency_symbol();
        ?>

                    <span class="order-title"><?php 
        echo $store_settings['store_name'];
        ?>
</span>
                    <div class="order-raw">
                        <input type="radio" name="dokan_product_shipping_choice[<?php 
        echo $vendor_id;
        ?>
]" class="dokan_product_shipping_choice" data-id="<?php 
        echo $vendor_id;
        ?>
" value="dokan_product_pick_at_farm">
                        <label>Pick up at the farm (<?php 
        echo $store_settings['address'];
        ?>
)</label>
                        <?php 
        if ($shipping_charge == "yes") {
            ?>
                            <input type="radio" name="dokan_product_shipping_choice[<?php 
            echo $vendor_id;
            ?>
]" class="dokan_product_shipping_choice" data-id="<?php 
            echo $vendor_id;
            ?>
" value="dokan_product_shipping">
                            <label>Shipping (<?php 
            echo $currency_symbol . " " . $seller_shipping_charge;
            ?>
)</label>
                        <?php 
        }
        ?>
    
                    </div>
                <?php 
    }
    ?>
        </div>  
<?php 
}
开发者ID:abcode619,项目名称:wpstuff,代码行数:60,代码来源:woocommerce-custom-fields.php

示例6: seller_info_checkout

 /**
  * Injects seller name on checkout page
  *
  * @param array $item_data
  * @param array $cart_item
  * @return array
  */
 function seller_info_checkout($item_data, $cart_item)
 {
     $info = dokan_get_store_info($cart_item['data']->post->post_author);
     $seller = sprintf(__('<strong>Seller:</strong> %s', 'dokan'), $info['store_name']);
     $data = $item_data . $seller;
     return apply_filters('dokan_seller_info_checkout', $data, $info, $item_data, $cart_item);
 }
开发者ID:nuwe1,项目名称:dokan-lite,代码行数:14,代码来源:ajax.php

示例7: display_seller_review

 /**
  * Displaying Prodcuts
  *
  * Does prepare the data for displaying the products in the table.
  */
 function display_seller_review()
 {
     $data = array();
     $prefix = FARMTOYOU_META_PREFIX;
     //if search is call then pass searching value to function for displaying searching values
     $args = array('post_type' => FARMTOYOU_SELLER_REVIEW_POST_TYPE, 'post_status' => 'any', 'posts_per_page' => '-1');
     //get seller_review data from database
     $all_seller_review = get_posts($args);
     foreach ($all_seller_review as $key => $value) {
         $seller_id = get_post_meta($value->ID, $prefix . 'seller_id', true);
         $store_info = dokan_get_store_info($seller_id);
         $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
         $curr_user_id = get_post_meta($value->ID, $prefix . 'current_user_id', true);
         $user_info = get_userdata($curr_user_id);
         $first_name = $user_info->first_name;
         $last_name = $user_info->last_name;
         $user_email = $user_info->user_email;
         $data[$key]['ID'] = isset($value->ID) ? $value->ID : '';
         $data[$key]['seller_store'] = $store_name;
         $data[$key]['curr_user_name'] = $first_name . " " . $last_name;
         $data[$key]['curr_user_email'] = $user_email;
         $data[$key]['user_rating'] = get_post_meta($value->ID, $prefix . 'seller_rating', true);
         $data[$key]['user_comment'] = get_post_meta($value->ID, $prefix . 'user_comment', true);
         $data[$key]['post_status'] = isset($value->post_status) ? $value->post_status : '';
         $data[$key]['post_date'] = isset($value->post_date) ? $value->post_date : '';
     }
     return $data;
 }
开发者ID:abcode619,项目名称:wpstuff,代码行数:33,代码来源:custom-seller-review.php

示例8: 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)
    {
        if (!dokan_is_store_page()) {
            return;
        }
        extract($args, EXTR_SKIP);
        $title = apply_filters('widget_title', $instance['title']);
        $seller_id = (int) get_query_var('author');
        $store_info = dokan_get_store_info($seller_id);
        echo $before_widget;
        if (!empty($title)) {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        ?>

        <form id="dokan-form-contact-seller" action="" method="post" class="seller-form clearfix">
            <div class="ajax-response"></div>
            <ul>
                <li class="form-group">
                    <input type="text" name="name" value="" placeholder="<?php 
        esc_attr_e('Your Name', 'dokan');
        ?>
" class="form-control" minlength="5" required="required">
                </li>
                <li class="form-group">
                    <input type="email" name="email" value="" placeholder="<?php 
        esc_attr_e('you@example.com', 'dokan');
        ?>
" class="form-control" required="required">
                </li>
                <li class="form-group">
                    <textarea  name="message" maxlength="1000" cols="25" rows="6" value="" placeholder="<?php 
        esc_attr_e('Type your messsage...', 'dokan');
        ?>
" class="form-control" required="required"></textarea>
                </li>
            </ul>

            <?php 
        wp_nonce_field('dokan_contact_seller');
        ?>
            <input type="hidden" name="seller_id" value="<?php 
        echo $seller_id;
        ?>
">
            <input type="hidden" name="action" value="dokan_contact_seller">
            <input type="submit" name="store_message_send" value="<?php 
        esc_attr_e('Send Message', 'dokan');
        ?>
" class="dokan-right dokan-btn dokan-btn-theme">
        </form>

        <?php 
        echo $after_widget;
    }
开发者ID:abcode619,项目名称:wpstuff,代码行数:62,代码来源:store-contact.php

示例9: seller_info_intro

        function seller_info_intro()
        {
            $store_info = dokan_get_store_info(get_the_author_meta('ID'));
            $store_intro = $store_info['phone'];
            ?>
			<div><?php 
            echo $store_intro;
            ?>
</div>
			<?php 
        }
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:11,代码来源:marketica-seller-info.php

示例10: dokan_get_profile_progressbar

 function dokan_get_profile_progressbar()
 {
     global $current_user;
     $profile_info = dokan_get_store_info($current_user->ID);
     $progress = isset($profile_info['profile_completion']['progress']) ? $profile_info['profile_completion']['progress'] : 0;
     $next_todo = isset($profile_info['profile_completion']['next_todo']) ? $profile_info['profile_completion']['next_todo'] : __('Start with adding a Banner to gain profile progress', 'dokan');
     ob_start();
     if (strlen(trim($next_todo)) != 0) {
         dokan_get_template_part('global/profile-progressbar', '', array('pro' => true, 'progress' => $progress, 'next_todo' => $next_todo));
     }
     $output = ob_get_clean();
     return $output;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:13,代码来源:functions.php

示例11: __construct

 /**
  * Load autometically when class initiate
  *
  * @since 2.4
  *
  * @uses actions hook
  * @uses filter hook
  *
  * @return void
  */
 public function __construct()
 {
     $this->currentuser = get_current_user_id();
     $this->profile_info = dokan_get_store_info(get_current_user_id());
     add_filter('dokan_get_dashboard_settings_nav', array($this, 'load_settings_menu'), 10);
     add_filter('dokan_dashboard_settings_heading_title', array($this, 'load_settings_header'), 10, 2);
     add_filter('dokan_dashboard_settings_helper_text', array($this, 'load_settings_helper_text'), 10, 2);
     add_action('dokan_ajax_settings_response', array($this, 'add_progressbar_in_settings_save_response'), 10);
     add_action('dokan_settings_load_ajax_response', array($this, 'render_pro_settings_load_progressbar'), 25);
     add_action('dokan_settings_render_profile_progressbar', array($this, 'load_settings_progressbar'), 10, 2);
     add_action('dokan_settings_content_area_header', array($this, 'render_shipping_status_message'), 25);
     add_action('dokan_render_settings_content', array($this, 'load_settings_content'), 10);
 }
开发者ID:nealmattox,项目名称:updatednebrowse,代码行数:23,代码来源:settings.php

示例12: 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)
 {
     if (!dokan_is_store_page()) {
         return;
     }
     extract($args, EXTR_SKIP);
     $title = apply_filters('widget_title', $instance['title']);
     $store_info = dokan_get_store_info(get_query_var('author'));
     $map_location = isset($store_info['location']) ? esc_attr($store_info['location']) : '';
     echo $before_widget;
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     dokan_get_template_part('widgets/store-map', '', array('pro' => true, 'store_info' => $store_info, 'map_location' => $map_location));
     echo $after_widget;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:24,代码来源:store-location.php

示例13: 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)
 {
     if (!dokan_is_store_page()) {
         return;
     }
     extract($args, EXTR_SKIP);
     $title = apply_filters('widget_title', $instance['title']);
     $seller_id = (int) get_query_var('author');
     $store_info = dokan_get_store_info($seller_id);
     echo $before_widget;
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     dokan_get_template_part('widgets/store-contact-form', '', array('pro' => true, 'seller_id' => $seller_id, 'store_info' => $store_info));
     echo $after_widget;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:24,代码来源:store-contact.php

示例14: 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

示例15: 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)
    {
        if (!dokan_is_store_page()) {
            return;
        }
        extract($args, EXTR_SKIP);
        $title = apply_filters('widget_title', $instance['title']);
        $store_info = dokan_get_store_info(get_query_var('author'));
        $map_location = isset($store_info['location']) ? esc_attr($store_info['location']) : '';
        echo $before_widget;
        if (!empty($title)) {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        ?>

        <div class="location-container">

            <?php 
        if (!empty($map_location)) {
            ?>
                <div id="dokan-store-location"></div>

                <script type="text/javascript">
                    jQuery(function($) {
                        <?php 
            $locations = explode(',', $map_location);
            $def_lat = isset($locations[0]) ? $locations[0] : 90.40714300000002;
            $def_long = isset($locations[1]) ? $locations[1] : 23.709921;
            ?>

                        var def_longval = <?php 
            echo $def_long;
            ?>
;
                        var def_latval = <?php 
            echo $def_lat;
            ?>
;

                        var curpoint = new google.maps.LatLng(def_latval, def_longval),
                            $map_area = $('#dokan-store-location');

                        var gmap = new google.maps.Map( $map_area[0], {
                            center: curpoint,
                            zoom: 15,
                            mapTypeId: window.google.maps.MapTypeId.ROADMAP
                        });

                        var marker = new window.google.maps.Marker({
                            position: curpoint,
                            map: gmap
                        });
                    })

                </script>
            <?php 
        }
        ?>
        </div>

        <?php 
        echo $after_widget;
    }
开发者ID:abcode619,项目名称:wpstuff,代码行数:70,代码来源:store-location.php


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