示例#1
0
 /**
  * Adds proper hooks for output of meta tags
  *
  * @return void
  */
 function output_meta_tags()
 {
     if (!dokan_is_store_page()) {
         return;
     }
     if (dokan_get_option('store_seo', 'dokan_general') === 'off') {
         return;
     }
     $this->store_info = dokan_get_store_info(get_query_var('author'));
     if (class_exists('All_in_One_SEO_Pack')) {
         add_filter('aioseop_title', array($this, 'replace_title'), 500);
         add_filter('aioseop_keywords', array($this, 'replace_keywords'), 100);
         add_filter('aioseop_description', array($this, 'replace_desc'), 100);
         add_action('wp_head', array($this, 'print_social_tags'), 1);
     } elseif (class_exists('WPSEO_Frontend')) {
         add_filter('wp_title', array($this, 'replace_title'), 500);
         add_filter('wpseo_metakeywords', array($this, 'replace_keywords'));
         add_filter('wpseo_metadesc', array($this, 'replace_desc'));
         add_filter('wpseo_opengraph_title', array($this, 'replace_og_title'));
         add_filter('wpseo_opengraph_desc', array($this, 'replace_og_desc'));
         add_filter('wpseo_opengraph_image', array($this, 'replace_og_img'));
         add_action('wpseo_opengraph', array($this, 'print_og_img'), 20);
         add_filter('wpseo_twitter_title', array($this, 'replace_twitter_title'));
         add_filter('wpseo_twitter_description', array($this, 'replace_twitter_desc'));
         add_filter('wpseo_twitter_image', array($this, 'replace_twitter_img'));
         add_action('wpseo_twitter', array($this, 'print_twitter_img'), 20);
     } else {
         add_filter('wp_title', array($this, 'replace_title'), 500);
         add_action('wp_head', array($this, 'print_tags'), 1);
         add_action('wp_head', array($this, 'print_social_tags'), 1);
     }
 }
示例#2
0
 /**
  * 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');
     dokan_store_category_menu($seller_id, $title);
 }
示例#3
0
 /**
  * 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;
 }
示例#4
0
    /**
     * 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('*****@*****.**', '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;
    }
示例#5
0
function tokopress_dokan_layout_class($layout)
{
    if (dokan_is_store_page()) {
        if (dokan_get_option('enable_theme_store_sidebar', 'dokan_general', 'off') == 'off') {
            $layout = 'layout-2c-l';
        } else {
            if (!of_get_option('tokopress_wc_hide_products_sidebar')) {
                $layout = 'layout-2c-l';
            } else {
                $layout = 'layout-1c-full';
            }
        }
    }
    return $layout;
}
示例#6
0
 /**
  * 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;
 }
示例#7
0
 /**
  * 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;
 }
示例#8
0
 /**
  * Create a nicely formatted and more specific title element text for output
  * in head of document, based on current view.
  *
  * @since Dokan 1.0.4
  *
  * @param string  $title Default title text for current view.
  * @param string  $sep   Optional separator.
  *
  * @return string The filtered title.
  */
 function wp_title($title, $sep)
 {
     global $paged, $page;
     if (is_feed()) {
         return $title;
     }
     if (dokan_is_store_page()) {
         $site_title = get_bloginfo('name');
         $store_user = get_userdata(get_query_var('author'));
         $store_info = dokan_get_store_info($store_user->ID);
         $store_name = esc_html($store_info['store_name']);
         $title = "{$store_name} {$sep} {$site_title}";
         // Add a page number if necessary.
         if ($paged >= 2 || $page >= 2) {
             $title = "{$title} {$sep} " . sprintf(__('Page %s', 'dokan'), max($paged, $page));
         }
         return $title;
     }
     return $title;
 }
示例#9
0
    /**
     * 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;
    }