pmtpenza

Untitled

Aug 3rd, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.87 KB | None | 0 0
  1. <div class="white-block filters-toggle">
  2. <div class="white-block-content">
  3. <h6>
  4. <a href="javascript:void(0);" class="toggle-filters"><?php esc_html_e( 'Toggle Filters', 'adifier' ) ?></a>
  5. </h6>
  6. </div>
  7. </div>
  8.  
  9. <?php
  10.  
  11. $current_id = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) )->term_id;
  12.  
  13. $terms = get_terms( array(
  14. 'taxonomy' => 'advert-category', // название таксономии с WP 4.5
  15. 'orderby' => 'name',
  16. 'order' => 'ASC',
  17. 'hide_empty' => false,
  18. 'object_ids' => null,
  19. 'include' => array(),
  20. 'exclude' => array(),
  21. 'exclude_tree' => array(),
  22. 'number' => '',
  23. 'fields' => 'all',
  24. 'count' => false,
  25. 'slug' => '',
  26. 'parent' => '',
  27. 'hierarchical' => true,
  28. 'child_of' => 0,
  29. 'get' => '', // ставим all чтобы получить все термины
  30. 'name__like' => '',
  31. 'pad_counts' => false,
  32. 'offset' => '',
  33. 'search' => '',
  34. 'cache_domain' => 'core',
  35. 'name' => '', // str/arr поле name для получения термина по нему. C 4.2.
  36. 'childless' => false, // true не получит (пропустит) термины у которых есть дочерние термины. C 4.2.
  37. 'update_term_meta_cache' => true, // подгружать метаданные в кэш
  38. 'meta_query' => '',
  39. ) );
  40.  
  41. echo '<ul class="element-categories-v-list list-unstyled cats">';
  42. foreach( $terms as $term ){
  43. $class = ($current_id == $term->term_id) ? 'active' : '';
  44. ?>
  45. <li class="<?php echo $class; ?>">
  46. <a href="<?php echo esc_url( get_term_link( $term ) ); ?>" class="flex-wrap">
  47. <div class="flex-wrap flex-start-h animation">
  48. <?php
  49. $advert_cat_icon = get_term_meta( $term->term_id, 'advert_cat_icon', true );
  50. if( !empty( $advert_cat_icon ) ){
  51. echo adifier_get_category_icon_img( $advert_cat_icon );
  52. }
  53. echo esc_html( $term->name );
  54. ?>
  55. </div>
  56. <?php
  57. if( $show_count == 'yes' ){
  58. ?>
  59. <div class="category-item-count"><?php echo esc_html( $term_count ).' '._n( 'ad', 'ads', $term_count, 'adifier' ); ?></div>
  60. <?php
  61. }
  62. ?>
  63. </a>
  64. </li>
  65. <?php
  66. }
  67. echo '</ul>';
  68.  
  69. ?>
  70.  
  71. <form method="post" class="search-form mt-4" action="<?php echo adifier_get_search_link(); ?>">
  72. <div class="white-block no-margin">
  73. <div class="white-block-title">
  74. <h5>Быстрый поиск</h5>
  75. <a href="javascript:void(0);" class="reset-search" data-toggle="tooltip" title="Очистить"><i class="aficon-undo"></i></a>
  76. </div>
  77.  
  78. <div class="white-block-content"><?php
  79. /*
  80. <div class="form-group">
  81. <label for="keyword">Что Вас интересует?</label>
  82. <input type="text" class="keyword" name="keyword" id="keyword" value="<?php echo esc_attr( $keyword ) ?>" placeholder="Например, обучение Таро">
  83. </div>
  84.  
  85. <div class="form-group">
  86. <?php Adifier_Custom_Fields_Search::taxonomy_filter( 'Меня интересуют:', 'category', 'advert-category', $category ); ?>
  87. </div>
  88. */
  89. $use_google_location = adifier_get_option( 'use_google_location' );
  90. $use_predefined_locations = adifier_get_option( 'use_predefined_locations' );
  91. $map_source = adifier_get_option( 'map_source' );
  92. ?>
  93. <?php if( $use_google_location !== 'no' || $use_predefined_locations !== 'no' ): ?>
  94. <div class="form-group">
  95. <?php
  96. $location_search = adifier_get_option( 'location_search' );
  97. ?>
  98. <?php if( $location_search == 'geo' ): ?>
  99. <label for="location"><?php esc_html_e( 'Location', 'adifier' ) ?></label>
  100. <input type="text" class="location" name="location" id="location" value="<?php echo esc_attr( $location ) ?>" placeholder="<?php esc_attr_e( 'Start typing...', 'adifier' ) ?>">
  101. <?php if( $map_source == 'google' ): ?>
  102. <input type="hidden" name="latitude" class="latitude" value="<?php echo esc_attr( $latitude ) ?>">
  103. <input type="hidden" name="longitude" class="longitude" value="<?php echo esc_attr( $longitude ) ?>">
  104. <?php endif; ?>
  105.  
  106. <div class="radius-slider <?php echo ( !empty( $location ) || $map_source == 'mapbox' ) ? '' : 'hidden' ?>">
  107. <label class="margin-above label-bottom-margin"><?php esc_html_e( 'Radius', 'adifier' ) ?></label>
  108. <div class="slider-wrap">
  109. <div class="filter-slider" data-min="0" data-max="<?php echo esc_attr( $radius_max ) ?>" data-default="<?php echo esc_attr( $radius_max ) ?>" data-sufix="<?php echo adifier_get_option( 'radius_units' ) ?>"></div>
  110. <input type="hidden" name="radius" class="radius" value="<?php echo esc_attr( $radius ) ?>">
  111. <div class="slider-value"></div>
  112. </div>
  113. </div>
  114. <?php else: ?>
  115. <?php Adifier_Custom_Fields_Search::taxonomy_filter( 'Где именно?', 'location_id', 'advert-location', $location_id ); ?>
  116. <?php endif; ?>
  117. </div>
  118. <?php endif; ?>
  119.  
  120. <div class="category-custom-fields">
  121. <?php
  122. if( !empty( $category ) ){
  123. Adifier_Custom_Fields_Search::get_cf_filter( $category );
  124. }
  125. ?>
  126. </div>
  127.  
  128. <?php /*
  129. $max_price = Adifier_Custom_Fields_Search::get_max_price();
  130. if( !empty( $max_price ) ):
  131. $currencies = adifier_get_currencies_raw_list();
  132. $price_slider_data = '';
  133. if( count( $currencies ) <= 1 ){
  134. $price_slider_data = 'data-decimal="'.esc_attr( adifier_get_option( 'decimal_separator' ) ).'" data-thousands="'.esc_attr( adifier_get_option( 'show_decimals' ) ).'" data-thousands="'.esc_attr( adifier_get_option( 'thousands_separator' ) ).'." '.$currency_location == 'front' ? 'data-prefix="'.esc_attr( $currency_symbol ).'"' : 'data-sufix="'.esc_attr( $currency_symbol ).'"';
  135. }
  136. ?>
  137. <div class="form-group">
  138. <label class="label-bottom-margin"><?php esc_html_e( 'Price', 'adifier' ) ?></label>
  139. <?php if( adifier_get_option( 'price_filter_type' ) == 'slider' ): ?>
  140. <div class="slider-wrap slider-range">
  141. <div class="filter-slider price-filter-slider" data-range="true" data-min="0" data-max="<?php echo esc_attr( (int)$max_price ) ?>" <?php echo $price_slider_data ?>></div>
  142. <input type="hidden" name="price" class="price" value="<?php echo esc_attr( $price ) ?>">
  143. <div class="slider-value"></div>
  144. </div>
  145. <?php else: ?>
  146. <div class="date-range">
  147. <input type="text" name="price[0]" value="<?php echo !empty( $price[0] ) ? esc_attr( $price[0] ) : '' ?>" placeholder="<?php esc_attr_e( 'min', 'adifier' ) ?>" />
  148. <input type="text" name="price[1]" value="<?php echo !empty( $price[1] ) ? esc_attr( $price[1] ) : '' ?>" placeholder="<?php esc_attr_e( 'max', 'adifier' ) ?>" />
  149. </div>
  150. <?php endif; ?>
  151. </div>
  152. <div class="form-group">
  153. <?php
  154. if( count( $currencies ) > 1 ){
  155. adifier_currency_select( $currencies, $currency, true );
  156. }
  157. ?>
  158. </div>
  159. <?php endif; ?>
  160.  
  161. <?php if( !adifier_is_single_ad_type() ): ?>
  162. <div class="form-group">
  163. <label class="label-bottom-margin"><?php esc_html_e( 'Type', 'adifier' ) ?></label>
  164. <ul class="list-unstyled">
  165. <li>
  166. <div class="styled-radio">
  167. <input type="radio" name="type" value="" id="type-0" <?php echo $type == '' ? 'checked="checked"' : '' ?>>
  168. <label for="type-0"><?php esc_html_e( 'All', 'adifier' ) ?></label>
  169. </div>
  170. </li>
  171. <?php if( adifier_is_allowed_ad_type(1) ): ?>
  172. <li>
  173. <div class="styled-radio">
  174. <input type="radio" name="type" value="1" id="type-1" <?php echo $type == '1' ? 'checked="checked"' : '' ?>>
  175. <label for="type-1"><?php esc_html_e( 'Sell', 'adifier' ) ?></label>
  176. </div>
  177. </li>
  178. <?php endif; ?>
  179. <?php if( adifier_is_allowed_ad_type(2) ): ?>
  180. <li>
  181. <div class="styled-radio">
  182. <input type="radio" name="type" value="2" id="type-2" <?php echo $type == '2' ? 'checked="checked"' : '' ?>>
  183. <label for="type-2"><?php esc_html_e( 'Auction', 'adifier' ) ?></label>
  184. </div>
  185. </li>
  186. <?php endif; ?>
  187. <?php if( adifier_is_allowed_ad_type(3) ): ?>
  188. <li>
  189. <div class="styled-radio">
  190. <input type="radio" name="type" value="3" id="type-3" <?php echo $type == '3' ? 'checked="checked"' : '' ?>>
  191. <label for="type-3"><?php esc_html_e( 'Buy', 'adifier' ) ?></label>
  192. </div>
  193. </li>
  194. <?php endif; ?>
  195. <?php if( adifier_is_allowed_ad_type(4) ): ?>
  196. <li>
  197. <div class="styled-radio">
  198. <input type="radio" name="type" value="4" id="type-4" <?php echo $type == '4' ? 'checked="checked"' : '' ?>>
  199. <label for="type-4"><?php esc_html_e( 'Exchange', 'adifier' ) ?></label>
  200. </div>
  201. </li>
  202. <?php endif; ?>
  203. <?php if( adifier_is_allowed_ad_type(5) ): ?>
  204. <li>
  205. <div class="styled-radio">
  206. <input type="radio" name="type" value="5" id="type-5" <?php echo $type == '5' ? 'checked="checked"' : '' ?>>
  207. <label for="type-5"><?php esc_html_e( 'Gift', 'adifier' ) ?></label>
  208. </div>
  209. </li>
  210. <?php endif; ?>
  211. <?php if( adifier_is_allowed_ad_type(6) ): ?>
  212. <li>
  213. <div class="styled-radio">
  214. <input type="radio" name="type" value="6" id="type-6" <?php echo $type == '6' ? 'checked="checked"' : '' ?>>
  215. <label for="type-6"><?php esc_html_e( 'Rent', 'adifier' ) ?></label>
  216. </div>
  217. </li>
  218. <?php endif; ?>
  219. <?php if( adifier_is_allowed_ad_type(7) ): ?>
  220. <li>
  221. <div class="styled-radio">
  222. <input type="radio" name="type" value="7" id="type-7" <?php echo $type == '7' ? 'checked="checked"' : '' ?>>
  223. <label for="type-7"><?php esc_html_e( 'Job - Offer', 'adifier' ) ?></label>
  224. </div>
  225. </li>
  226. <?php endif; ?>
  227. <?php if( adifier_is_allowed_ad_type(8) ): ?>
  228. <li>
  229. <div class="styled-radio">
  230. <input type="radio" name="type" value="8" id="type-8" <?php echo $type == '8' ? 'checked="checked"' : '' ?>>
  231. <label for="type-8"><?php esc_html_e( 'Job - Wanted', 'adifier' ) ?></label>
  232. </div>
  233. </li>
  234. <?php endif; ?>
  235. </ul>
  236. </div>
  237. <?php endif; ?>
  238.  
  239. <?php if( adifier_get_option( 'enable_conditions' ) == 'yes' ): ?>
  240. <div class="form-group">
  241. <label class="label-bottom-margin"><?php esc_html_e( 'Condition', 'adifier' ) ?></label>
  242. <ul class="list-unstyled">
  243. <li>
  244. <div class="styled-radio">
  245. <input type="radio" name="cond" value="" id="cond-0" <?php echo $cond == '' ? 'checked="checked"' : '' ?>>
  246. <label for="cond-0"><?php esc_html_e( 'All', 'adifier' ) ?></label>
  247. </div>
  248. </li>
  249. <li>
  250. <div class="styled-radio">
  251. <input type="radio" name="cond" value="1" id="cond-1" <?php echo $cond == '1' ? 'checked="checked"' : '' ?>>
  252. <label for="cond-1"><?php esc_html_e( 'New', 'adifier' ) ?></label>
  253. </div>
  254. </li>
  255. <li>
  256. <div class="styled-radio">
  257. <input type="radio" name="cond" value="2" id="cond-2" <?php echo $cond == '2' ? 'checked="checked"' : '' ?>>
  258. <label for="cond-2"><?php esc_html_e( 'Manufacturer Refurbished', 'adifier' ) ?></label>
  259. </div>
  260. </li>
  261. <li>
  262. <div class="styled-radio">
  263. <input type="radio" name="cond" value="3" id="cond-3" <?php echo $cond == '3' ? 'checked="checked"' : '' ?>>
  264. <label for="cond-3"><?php esc_html_e( 'Used', 'adifier' ) ?></label>
  265. </div>
  266. </li>
  267. <li>
  268. <div class="styled-radio">
  269. <input type="radio" name="cond" value="4" id="cond-4" <?php echo $cond == '4' ? 'checked="checked"' : '' ?>>
  270. <label for="cond-4"><?php esc_html_e( 'For Parts Or Not Working', 'adifier' ) ?></label>
  271. </div>
  272. </li>
  273. </ul>
  274. </div>
  275. <?php endif; ?>
  276.  
  277. <div class="form-group">
  278. <div class="styled-checkbox">
  279. <input type="checkbox" name="image-only" value="1" id="image-only" <?php echo $image_only ? 'checked="checked"' : '' ?>>
  280. <label for="image-only"><?php esc_html_e( 'Show ads with image(s) only', 'adifier' ) ?></label>
  281. </div>
  282. <?php if( !empty( str_replace( '|', '', adifier_get_option( 'promo_urgent' ) ) ) ): ?>
  283. <div class="styled-checkbox">
  284. <input type="checkbox" name="urgent-only" value="1" id="urgent-only" <?php echo $urgent_only ? 'checked="checked"' : '' ?>>
  285. <label for="urgent-only"><?php esc_html_e( 'Show only urgent ads', 'adifier' ) ?></label>
  286. </div>
  287. <?php endif; ?>
  288. </div>
  289. */ ?>
  290. <input type="hidden" name="category" value="<?php echo $current_id; ?>">
  291. <div class="submit-search-form">
  292. <a href="javascript:void(0);" class="af-button filter-adverts"><?php esc_html_e( 'Apply Filters', 'adifier' ) ?></a>
  293. </div>
  294. </div>
  295. </div>
  296. </form>
Advertisement
Add Comment
Please, Sign In to add comment