-
Notifications
You must be signed in to change notification settings - Fork 18
/
sidebar.php
195 lines (144 loc) · 6.29 KB
/
sidebar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
/**
* The Sidebar containing the main widget areas.
*
* @package dokani
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// If the navigation is set in the sidebar, set variable to true.
$navigation_active = ( 'nav-right-sidebar' == dokani_get_navigation_location() ) ? true : false;
// If the secondary navigation is set in the sidebar, set variable to true.
if ( function_exists( 'dokani_secondary_nav_get_defaults' ) ) {
$secondary_nav = wp_parse_args(
get_option( 'dokani_secondary_nav_settings', array() ),
dokani_secondary_nav_get_defaults()
);
if ( 'secondary-nav-right-sidebar' == $secondary_nav['secondary_nav_position_setting'] ) {
$navigation_active = true;
}
}
?>
<div id="right-sidebar" itemtype="https://schema.org/WPSideBar" itemscope="itemscope" <?php dokani_right_sidebar_class(); ?>>
<?php
if ( function_exists( 'dokan_is_store_listing' ) && dokan_is_store_listing() ) {
woocommerce_breadcrumb();
}
?>
<div class="inside-right-sidebar">
<?php
/**
* dokani_before_right_sidebar_content hook.
*
* @since 1.0.0
*/
do_action( 'dokani_before_right_sidebar_content' );
if ( function_exists( 'dokan_is_store_listing' ) && dokan_is_store_listing() ) :
if ( ! dynamic_sidebar( 'store-list' ) ) :
if ( false == $navigation_active ) : ?>
<aside id="search" class="widget widget_search">
<?php get_search_form(); ?>
</aside>
<?php
$dokani_product_category_widget_instance = array(
'title' => esc_html__( 'Browse Category', 'dokani' ),
);
$dokani_product_category_widget_args = array(
'before_widget' => '<aside class="widget dokan-category-menu">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
);
the_widget( 'WeDevs\Dokan\Widgets\ProductCategoryMenu', $dokani_product_category_widget_instance, $dokani_product_category_widget_args );
?>
<?php endif;
endif;
elseif ( is_archive( 'product' ) ) :
if ( ! dynamic_sidebar( 'shop' ) ) :
if ( false == $navigation_active ) : ?>
<aside id="archives" class="widget">
<h2 class="widget-title"><?php esc_html_e( 'Archives', 'dokani' ); ?></h2>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>
<?php endif;
endif;
elseif ( class_exists( 'WooCommerce' ) && is_product() ) :
if ( ! dynamic_sidebar( 'product' ) ) :
if ( false == $navigation_active ) : ?>
<aside id="archives" class="widget">
<h2 class="widget-title"><?php esc_html_e( 'Archives', 'dokani' ); ?></h2>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>
<?php endif;
endif;
elseif ( function_exists( 'dokan_is_store_page' ) && dokan_is_store_page() ) :
if ( dokan_get_option( 'enable_theme_store_sidebar', 'dokan_general', 'off' ) == 'off' ) :
if ( ! dynamic_sidebar( 'sidebar-store' ) ) :
$args = array(
'before_widget' => '<aside class="widget inner-padding">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
);
if ( class_exists( 'Dokan_Store_Location' ) ) :
the_widget( 'WeDevs\Dokan\Widgets\StoreCategoryMenu', array( 'title' => __( 'Store Category', 'dokani' ) ), $args );
if ( dokan_get_option( 'store_map', 'dokan_general', 'on' ) == 'on' ) {
the_widget( 'WeDevs\Dokan\Widgets\StoreLocation', array( 'title' => __( 'Store Location', 'dokani' ) ), $args );
}
if ( dokan_get_option( 'contact_seller', 'dokan_general', 'on' ) == 'on' ) {
the_widget( 'WeDevs\Dokan\Widgets\StoreContactForm', array( 'title' => __( 'Contact Vendor', 'dokani' ) ), $args );
}
endif;
endif;
else :
if ( ! dynamic_sidebar( 'sidebar-store' ) ) :
$args = array(
'before_widget' => '<aside class="widget inner-padding">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
);
if ( false == $navigation_active ) : ?>
<?php
if ( class_exists( 'Dokan_Store_Location' ) ) {
the_widget( 'WeDevs\Dokan\Widgets\StoreCategoryMenu', array( 'title' => __( 'Store Category', 'dokani' ) ), $args );
if ( dokan_get_option( 'store_map', 'dokan_general', 'on' ) == 'on' ) {
the_widget( 'WeDevs\Dokan\Widgets\StoreLocation', array( 'title' => __( 'Store Location', 'dokani' ) ), $args );
}
if ( dokan_get_option( 'contact_seller', 'dokan_general', 'on' ) == 'on' ) {
the_widget( 'WeDevs\Dokan\Widgets\StoreContactForm', array( 'title' => __( 'Contact Vendor', 'dokani' ) ), $args );
}
}
?>
<?php endif;
endif;
endif;
else :
if ( ! dynamic_sidebar( 'sidebar-1' ) ) :
if ( false == $navigation_active ) : ?>
<aside id="search" class="widget widget_search">
<?php get_search_form(); ?>
</aside>
<aside id="archives" class="widget">
<h2 class="widget-title"><?php esc_html_e( 'Archives', 'dokani' ); ?></h2>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>
<?php endif;
endif;
endif;
/**
* dokani_after_right_sidebar_content hook.
*
* @since 1.0.0
*/
do_action( 'dokani_after_right_sidebar_content' );
?>
</div><!-- .inside-right-sidebar -->
</div><!-- #secondary -->