• Resolved barnwoodstar

    (@barnwoodstar)


    Hello again! First, I would just like to say that the support on this plugin is phenomenal. Thank you!

    Second, I have an issue with the Dokan seller widgets not displaying in my own sidebar. I have the Dokan settings set to “Enable showing store sidebar from your theme”. This works and I can see my own store sidebar on the seller store pages, but I can’t see the Dokan widgets that I have added to that sidebar, such as the Dokan: Store Location widget. Here is an example of a seller page on my site: https://www.barnwoodstar.ca/shop/wood-flame-candles/.

    This could be related to the fact that I have a custom Dokan store template that I am using, but I’m not sure.

    Here is my custom store.php template:

    <?php
    /**
     * The Template for displaying all single posts.
     *
     * @package dokan
     * @package dokan - 2014 1.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    
    $store_user   = get_userdata( get_query_var( 'author' ) );
    $store_info   = dokan_get_store_info( $store_user->ID );
    $map_location = isset( $store_info['location'] ) ? esc_attr( $store_info['location'] ) : '';
    
    get_header( 'shop' );
    ?>
    
    <div class="main wrap cf">
        <?php do_action( 'woocommerce_before_main_content' ); ?>
    	<div class="row">
    		<div class="col-8 main-content">
    
        <div id="dokan-primary" class="dokan-single-store dokan-w8 page-content">
            <div id="dokan-content" class="store-page-wrap woocommerce" role="main">
    
                <?php dokan_get_template_part( 'store-header' ); ?>
    
                <?php do_action( 'dokan_store_profile_frame_after', $store_user, $store_info ); ?>
    
                <?php if ( have_posts() ) { ?>
    
                    <div class="seller-items">
    
                        <?php woocommerce_product_loop_start(); ?>
    
                            <?php while ( have_posts() ) : the_post(); ?>
    
                                <?php wc_get_template_part( 'content', 'product' ); ?>
    
                            <?php endwhile; // end of the loop. ?>
    
                        <?php woocommerce_product_loop_end(); ?>
    
                    </div>
    
                    <?php dokan_content_nav( 'nav-below' ); ?>
    
                <?php } else { ?>
    
                    <p class="dokan-info"><?php _e( 'No products were found of this vendor!', 'dokan-lite' ); ?></p>
    
                <?php } ?>
            </div>
    
        </div><!-- .dokan-single-store -->
    
    		</div><!-- main content -->
    
    		<?php if ( dokan_get_option( 'enable_theme_store_sidebar', 'dokan_general', 'off' ) == 'off' ) { ?>
    <aside class="col-4 sidebar">
            <div id="dokan-secondary" class="dokan-clearfix dokan-w3 dokan-store-sidebar" role="complementary" style="margin-right:3%;">
                <div class="dokan-widget-area widget-collapse">
                     <?php do_action( 'dokan_sidebar_store_before', $store_user, $store_info ); ?>
                    <?php
                    if ( ! dynamic_sidebar( 'sidebar-store' ) ) {
    
                        $args = array(
                            'before_widget' => '<aside class="widget">',
                            'after_widget'  => '</aside>',
                            'before_title'  => '<h3 class="widgettitle">',
                            'after_title'   => '</h3>',
                        );
    
                        if ( class_exists( 'Dokan_Store_Location' ) ) {
                            //the_widget( 'Dokan_Store_Category_Menu', array( 'title' => __( 'Store Categories', 'dokan-lite' ) ), $args );
    
                            if ( dokan_get_option( 'store_map', 'dokan_general', 'on' ) == 'on' ) {
                                the_widget( 'Dokan_Store_Location', array( 'title' => __( 'Store Location', 'dokan-lite' ) ), $args );
                            }
    
                            if ( dokan_get_option( 'contact_seller', 'dokan_general', 'on' ) == 'on' ) {
                                //the_widget( 'Dokan_Store_Contact_Form', array( 'title' => __( 'Contact Vendor', 'dokan-lite' ) ), $args );
                            }
                        }
    
                    }
                    ?>
    
                    <?php do_action( 'dokan_sidebar_store_after', $store_user, $store_info ); ?>
    		
                </div>
    		<?php //Bunyad::core()->theme_sidebar(); ?>
            </div><!-- #secondary .widget-area -->
    </aside>
        <?php
        } else {
            get_sidebar( 'sidebar' );
    	//Bunyad::core()->theme_sidebar();
        }
        ?>		
    
    		
    	</div><!-- row -->
    
    <?php do_action( 'woocommerce_after_main_content' ); ?>
    
    </div><!-- main wrap -->
    
    <?php get_footer( 'shop' ); ?>
    

    Thank you in advance!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @barnwoodstar,

    Thank you very much for the feedback about our support. The store page default sidebars are loading from the plugin template file ‘store.php’. Now, as you set the settings “Enable showing store sidebar from your theme” for that reason the store page sidebar is coming from your theme default sidebar. All the store sidebar will be available if you disable the option “Enable showing store sidebar from your theme”.

    Can you please check and let me know the result?

    Thread Starter barnwoodstar

    (@barnwoodstar)

    Hi Nazmul,

    Thanks for the response!

    Maybe I am not understanding what’s supposed to be happening. I am wanting to show the sidebar from my own theme, including the Dokan Store Location widget. When I enable the “showing store sidebar from your theme” option, I see my own theme sidebar, but not the Dokan store location widget that I added to that sidebar area. When I disable it, I see the location in the sidebar, but not my own theme sidebar.

    I would like my own theme sidebar, with the Dokan location widget. Does that make sense?
    Screenshot: https://www.barnwoodstar.ca/wp-content/uploads/2017/04/Screen-Shot-2017-04-13-at-10.11.59-PM.jpg

    Thanks!!!

    • This reply was modified 7 years, 10 months ago by barnwoodstar.

    @barnwoodstar, Thanks for getting back to me again. The store location widget has been created only for the dokan-store page template. For that reason, it is not showing on your theme sidebar widget area.

    Now, if you want to show the store location sidebar on your own theme widget area then you have to modify the store location widget. Please open dokan/includes/widgets/store-locatopn.php file. In this file, you will see that we have inserted a condition to make sure if the page is not store page template then return –

    
            if ( ! dokan_is_store_page() ) {
                return;
            }
    

    You can comment out the above line from the function function widget( $args, $instance ). Except for this solution, I do not have alternate solution for you ??

    Thread Starter barnwoodstar

    (@barnwoodstar)

    Hi Nazmul,

    Thank you so much for your solution!

    I actually ended up finding my own solution to this. I registered a new sidebar location and added it to the store.php template file underneath the Dokan sidebars.

    Thanks again for the great support.

    Plugin Author weDevs

    (@wedevs)

    You are most welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dokan Seller Location Widget Not Displaying’ is closed to new replies.