function woof_draw_select_childs_h(&$collector, $selected_chain, $parent_data, $show_chain_always) { extract($parent_data); global $WOOF; $request = $WOOF->get_request_data(); //*** if (empty($parent_data['childs']) and $show_chain_always) { ?> <select class="woof_select woof_select_<?php echo $tax_slug; ?> woof_select_<?php echo $tax_slug; ?> _<?php echo $level; ?> " name="<?php echo $tax_slug; ?> " disabled=""> <option value="0"><?php echo WOOF_HELPER::wpml_translate($taxonomy_info, '', $level); ?> </option> </select> <?php if ($level < $deep - 1) { $parent_data['level'] += 1; woof_draw_select_childs_h($collector, $selected_chain, $parent_data, $show_chain_always); } } else { $woof_hide_dynamic_empty_pos = 0; //*** $current_request = array(); if ($WOOF->is_isset_in_request_data($tax_slug)) { $current_request = $request[$tax_slug]; $current_request = explode(',', urldecode($current_request)); } //excluding hidden terms $hidden_terms = array(); if (isset($WOOF->settings['excluded_terms'][$tax_slug])) { $hidden_terms = explode(',', $WOOF->settings['excluded_terms'][$tax_slug]); } $childs = apply_filters('woof_sort_terms_before_out', $childs, 'select'); $parent_data = array(); ?> <?php if (!empty($childs)) { ?> <select class="woof_select woof_select_<?php echo $tax_slug; ?> woof_select_<?php echo $tax_slug; ?> _<?php echo $level; ?> " name="<?php echo $tax_slug; ?> "> <option value="0"><?php echo WOOF_HELPER::wpml_translate($taxonomy_info, '', $level); ?> </option> <?php foreach ($childs as $term) { ?> <?php $count_string = ""; $count = 0; if (!in_array($term['slug'], $current_request)) { if ($show_count) { if ($show_count_dynamic) { $count = $WOOF->dynamic_count($term, 1, $_REQUEST['additional_taxes']); } else { $count = $term['count']; } $count_string = '(' . $count . ')'; } //+++ if ($hide_dynamic_empty_pos and $count == 0) { continue; } } if ($_REQUEST['hide_terms_count_txt']) { $count_string = ""; } //excluding hidden terms if (in_array($term['term_id'], $hidden_terms)) { continue; } ?> <option <?php if ($show_count and $count == 0 and !in_array($term['slug'], $current_request)) { ?> disabled=""<?php } ?> value="<?php echo $term['slug']; ?> " <?php echo selected(isset($selected_chain['chain'][$level]) and $selected_chain['chain'][$level] == $term['term_id']); ?> ><?php if (has_filter('woof_before_term_name')) { echo apply_filters('woof_before_term_name', $term, $taxonomy_info); } else { echo $term['name']; } ?> <?php echo $count_string; ?> </option> <?php if (!isset($collector[$tax_slug])) { $collector[$tax_slug] = array(); } $collector[$tax_slug][] = array('name' => $term['name'], 'slug' => $term['slug']); if (isset($selected_chain['chain'][$level]) and $selected_chain['chain'][$level] == $term['term_id']) { $parent_data['taxonomy_info'] = $taxonomy_info; $parent_data['tax_slug'] = $tax_slug; $parent_data['childs'] = $term['childs']; $parent_data['level'] = $level + 1; //this IS the index for $selected_chain on child drop-down $parent_data['deep'] = $deep; $parent_data['show_count'] = $show_count; $parent_data['show_count_dynamic'] = $show_count_dynamic; $parent_data['hide_dynamic_empty_pos'] = $hide_dynamic_empty_pos; } //+++ ?> <?php } ?> </select> <?php } ?> <?php if (!empty($parent_data)) { if (!empty($parent_data['childs'])) { woof_draw_select_childs_h($collector, $selected_chain, $parent_data, $show_chain_always); } } else { if (empty($parent_data) and $show_chain_always) { $parent_data['taxonomy_info'] = $taxonomy_info; $parent_data['tax_slug'] = $tax_slug; $parent_data['childs'] = array(); $parent_data['level'] = $level + 1; //this IS the index for $selected_chain on child drop-down $parent_data['deep'] = $deep; $parent_data['show_count'] = $show_count; $parent_data['show_count_dynamic'] = $show_count_dynamic; $parent_data['hide_dynamic_empty_pos'] = $hide_dynamic_empty_pos; //*** if ($level < $deep - 1) { woof_draw_select_childs_h($collector, $selected_chain, $parent_data, $show_chain_always); } } } } }
<?php } ?> <?php } } ?> <select class="woof_select woof_select_<?php echo $tax_slug; ?> " name="<?php echo $tax_slug; ?> "> <option value="0"><?php echo WOOF_HELPER::wpml_translate($taxonomy_info); ?> </option> <?php $woof_tax_values = array(); $current_request = array(); $request = $this->get_request_data(); if ($this->is_isset_in_request_data($tax_slug)) { $current_request = $request[$tax_slug]; $current_request = explode(',', urldecode($current_request)); } //excluding hidden terms $hidden_terms = array(); if (isset($this->settings['excluded_terms'][$tax_slug])) { $hidden_terms = explode(',', $this->settings['excluded_terms'][$tax_slug]); }
function woof_print_tax($taxonomies, $tax_slug, $terms, $exclude_tax_key, $taxonomies_info, $additional_taxes, $woof_settings, $args, $counter) { global $WOOF; if ($exclude_tax_key == $tax_slug) { //$terms = apply_filters('woof_exclude_tax_key', $terms); if (empty($terms)) { return; } } //*** if (!woof_only($tax_slug, 'taxonomy')) { return; } //*** $args['taxonomy_info'] = $taxonomies_info[$tax_slug]; $args['tax_slug'] = $tax_slug; $args['terms'] = $terms; $args['all_terms_hierarchy'] = $taxonomies[$tax_slug]; $args['additional_taxes'] = $additional_taxes; //*** $woof_container_styles = ""; if ($woof_settings['tax_type'][$tax_slug] == 'radio' or $woof_settings['tax_type'][$tax_slug] == 'checkbox') { if ($WOOF->settings['tax_block_height'][$tax_slug] > 0) { $woof_container_styles = "max-height:{$WOOF->settings['tax_block_height'][$tax_slug]}px; overflow-y: auto;"; } } //*** //https://wordpress.org/support/topic/adding-classes-woof_container-div $primax_class = sanitize_key(WOOF_HELPER::wpml_translate($taxonomies_info[$tax_slug])); ?> <div data-css-class="woof_container_<?php echo $tax_slug; ?> " class="woof_container woof_container_<?php echo $woof_settings['tax_type'][$tax_slug]; ?> woof_container_<?php echo $tax_slug; ?> woof_container_<?php echo $counter; ?> woof_container_<?php echo $primax_class; ?> "> <div class="woof_container_overlay_item"></div> <div class="woof_container_inner woof_container_inner_<?php echo $primax_class; ?> "> <?php switch ($woof_settings['tax_type'][$tax_slug]) { case 'checkbox': if ($WOOF->settings['show_title_label'][$tax_slug]) { ?> <h4><?php echo WOOF_HELPER::wpml_translate($taxonomies_info[$tax_slug]); ?> </h4> <?php } ?> <div <?php if (!empty($woof_container_styles)) { ?> style="<?php echo $woof_container_styles; ?> " class="woof_section_scrolled"<?php } ?> > <?php echo $WOOF->render_html(WOOF_PATH . 'views/html_types/checkbox.php', $args); ?> </div> <?php break; case 'select': if ($WOOF->settings['show_title_label'][$tax_slug]) { ?> <h4><?php echo WOOF_HELPER::wpml_translate($taxonomies_info[$tax_slug]); ?> </h4> <?php } echo $WOOF->render_html(WOOF_PATH . 'views/html_types/select.php', $args); break; case 'mselect': if ($WOOF->settings['show_title_label'][$tax_slug]) { ?> <h4><?php echo WOOF_HELPER::wpml_translate($taxonomies_info[$tax_slug]); ?> </h4> <?php } echo $WOOF->render_html(WOOF_PATH . 'views/html_types/mselect.php', $args); break; default: if ($WOOF->settings['show_title_label'][$tax_slug]) { ?> <h4><?php echo WOOF_HELPER::wpml_translate($taxonomies_info[$tax_slug]); ?> </h4> <?php } ?> <div <?php if (!empty($woof_container_styles)) { ?> style="<?php echo $woof_container_styles; ?> " class="woof_section_scrolled"<?php } ?> > <?php if (!empty(WOOF_EXT::$includes['taxonomy_type_objects'])) { $is_custom = false; foreach (WOOF_EXT::$includes['taxonomy_type_objects'] as $obj) { if ($obj->html_type == $woof_settings['tax_type'][$tax_slug]) { $is_custom = true; $args['woof_settings'] = $woof_settings; $args['taxonomies_info'] = $taxonomies_info; echo $WOOF->render_html($obj->get_html_type_view(), $args); break; } } if (!$is_custom) { echo $WOOF->render_html(WOOF_PATH . 'views/html_types/radio.php', $args); } } else { echo $WOOF->render_html(WOOF_PATH . 'views/html_types/radio.php', $args); } ?> </div> <?php break; } ?> </div> </div> <?php }
<h4><?php echo WOOF_HELPER::wpml_translate($taxonomies_info[$tax_slug]); ?> </h4> <?php } echo $this->render_html(WOOF_PATH . 'views/html_types/mselect.php', $args); break; case 'color': //premium only break; default: if ($this->settings['show_title_label'][$tax_slug]) { ?> <h4><?php echo WOOF_HELPER::wpml_translate($taxonomies_info[$tax_slug]); ?> </h4> <?php } ?> <div <?php if (!empty($woof_container_styles)) { ?> style="<?php echo $woof_container_styles; ?> "<?php } ?> >
<div class="woof_container_inner"> <?php global $WOOF; $woof_text = ''; $request = $WOOF->get_request_data(); if (isset($request['woof_text'])) { $woof_text = $request['woof_text']; } //+++ if (!isset($placeholder)) { $p = __('enter a product title here ...', 'woocommerce-products-filter'); } if (isset($WOOF->settings['by_text']['placeholder']) and !isset($placeholder)) { if (!empty($WOOF->settings['by_text']['placeholder'])) { $p = $WOOF->settings['by_text']['placeholder']; $p = WOOF_HELPER::wpml_translate(null, $p); $p = __($p, 'woocommerce-products-filter'); } if ($WOOF->settings['by_text']['placeholder'] == 'none') { $p = ''; } } //*** $unique_id = uniqid('woof_text_search_'); ?> <table class="woof_text_table"> <tr> <td style="width: 100%;"> <input type="search" class="woof_show_text_search <?php echo $unique_id;