Beispiel #1
0
/**
 * Get seller rating in a readable rating format
 *
 * @param int $seller_id
 * @return void
 */
function dokan_get_readable_seller_rating($seller_id)
{
    $rating = dokan_get_seller_rating($seller_id);
    if (!$rating['count']) {
        echo __('No ratings found yet!', 'dokan');
        return;
    }
    $long_text = _n(__('%s rating from %d review', 'dokan'), __('%s rating from %d reviews', 'dokan'), $rating['count'], 'dokan');
    $text = sprintf(__('Rated %s out of %d', 'dokan'), $rating['rating'], number_format(5));
    $width = $rating['rating'] / 5 * 100;
    ?>
        <span class="seller-rating">
            <span title="<?php 
    echo esc_attr($text);
    ?>
" class="star-rating" itemtype="http://schema.org/Rating" itemscope="" itemprop="reviewRating">
                <span class="width" style="width: <?php 
    echo $width;
    ?>
%"></span>
                <span style=""><strong itemprop="ratingValue"><?php 
    echo $rating['rating'];
    ?>
</strong></span>
            </span>
        </span>

        <span class="text"><a href="<?php 
    echo dokan_get_review_url($seller_id);
    ?>
"><?php 
    printf($long_text, $rating['rating'], $rating['count']);
    ?>
</a></span>

    <?php 
}
Beispiel #2
0
/**
 * Get tabs for showing in a single store page
 *
 * @since 2.2
 *
 * @param  int  $store_id
 *
 * @return array
 */
function dokan_get_store_tabs($store_id)
{
    $tabs = array('products' => array('title' => __('Products', 'dokan'), 'url' => dokan_get_store_url($store_id)), 'reviews' => array('title' => __('Reviews', 'dokan'), 'url' => dokan_get_review_url($store_id)));
    $store_info = dokan_get_store_info($store_id);
    $tnc_enable = dokan_get_option('seller_enable_terms_and_conditions', 'dokan_selling', 'off');
    if (isset($store_info['enable_tnc']) && $store_info['enable_tnc'] == 'on' && $tnc_enable == 'on') {
        $tabs['terms_and_conditions'] = array('title' => __('Terms and Conditions', 'dokan'), 'url' => dokan_get_toc_url($store_id));
    }
    return apply_filters('dokan_store_tabs', $tabs, $store_id);
}
Beispiel #3
0
                            <span class="rating-title"><?php 
    _e('No ratings found yet!', 'dokan');
    ?>
</span>
                        <?php 
}
?>
       
                    </div>         

                    <ul>
                        <?php 
if (!empty($number_of_review)) {
    ?>
                            <li><a href="<?php 
    echo dokan_get_review_url($store_user->ID);
    ?>
"><?php 
    echo sprintf(_n('%s review', '%s reviews', $number_of_review, 'farmtoyou'), $number_of_review);
    ?>
</a></li>
                        <?php 
}
?>
                        <?php 
if (is_user_logged_in()) {
    ?>
                            <li><a class="fancybox" href="#seller-review"><?php 
    _e('Write a review', 'dokan');
    ?>
</a></li>
Beispiel #4
0
 /**
  * Add Review Tab in Store Page
  *
  * @since 2.4.3
  *
  * @param array $tabs
  * @param integer $store_id
  *
  * @return array
  */
 public function add_review_tab_in_store($tabs, $store_id)
 {
     $tabs['reviews'] = array('title' => __('Reviews', 'dokan'), 'url' => dokan_get_review_url($store_id));
     return $tabs;
 }