예제 #1
0
 function woocommerce_get_product_thumbnail($size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0)
 {
     global $product;
     if ($product->is_type('variable')) {
         global $prdctfltr_global;
         $pf_activated = isset($prdctfltr_global['active_filters']) ? $prdctfltr_global['active_filters'] : array();
         if (!empty($pf_activated)) {
             $attrs = array();
             foreach ($pf_activated as $k => $v) {
                 if (substr($k, 0, 3) == 'pa_') {
                     $attrs = $attrs + array($k => $v[0]);
                 }
             }
             if (count($attrs) > 0) {
                 $curr_var = $product->get_available_variations();
                 foreach ($curr_var as $key => $var) {
                     $curr_var_set[$key]['attributes'] = $var['attributes'];
                     $curr_var_set[$key]['variation_id'] = $var['variation_id'];
                 }
                 $found = WC_Prdctfltr::prdctrfltr_search_array($curr_var_set, $attrs);
             }
         }
     }
     if (isset($found[0]) && $found[0]['variation_id'] && has_post_thumbnail($found[0]['variation_id'])) {
         $image = get_the_post_thumbnail($found[0]['variation_id'], $size);
     } elseif (has_post_thumbnail($product->id)) {
         $image = get_the_post_thumbnail($product->id, $size);
     } elseif (($parent_id = wp_get_post_parent_id($product->id)) && has_post_thumbnail($parent_id)) {
         $image = get_the_post_thumbnail($product, $size);
     } else {
         $image = wc_placeholder_img($size);
     }
     return $image;
 }
예제 #2
0
 function __construct()
 {
     self::$dir = trailingslashit(dirname(__FILE__));
     self::$path = trailingslashit(plugin_dir_path(__FILE__));
     self::$url_path = plugins_url(trailingslashit(basename(self::$dir)));
     self::$settings['permalink_structure'] = get_option('permalink_structure');
     self::$settings['wc_settings_prdctfltr_disable_scripts'] = get_option('wc_settings_prdctfltr_disable_scripts', array());
     self::$settings['wc_settings_prdctfltr_ajax_js'] = get_option('wc_settings_prdctfltr_ajax_js', '');
     self::$settings['wc_settings_prdctfltr_custom_tax'] = get_option('wc_settings_prdctfltr_custom_tax', 'no');
     self::$settings['wc_settings_prdctfltr_enable'] = get_option('wc_settings_prdctfltr_enable', 'yes');
     self::$settings['wc_settings_prdctfltr_default_templates'] = get_option('wc_settings_prdctfltr_default_templates', 'no');
     self::$settings['wc_settings_prdctfltr_force_categories'] = get_option('wc_settings_prdctfltr_force_categories', 'no');
     self::$settings['wc_settings_prdctfltr_instock'] = get_option('wc_settings_prdctfltr_instock', 'no');
     self::$settings['wc_settings_prdctfltr_use_ajax'] = get_option('wc_settings_prdctfltr_use_ajax', 'no');
     self::$settings['wc_settings_prdctfltr_ajax_class'] = get_option('wc_settings_prdctfltr_ajax_class', '');
     self::$settings['wc_settings_prdctfltr_ajax_product_class'] = get_option('wc_settings_prdctfltr_ajax_product_class', '');
     self::$settings['wc_settings_prdctfltr_ajax_columns'] = get_option('wc_settings_prdctfltr_ajax_columns', '4');
     self::$settings['wc_settings_prdctfltr_ajax_rows'] = get_option('wc_settings_prdctfltr_ajax_rows', '4');
     self::$settings['wc_settings_prdctfltr_force_redirects'] = get_option('wc_settings_prdctfltr_force_redirects', 'no');
     self::$settings['wc_settings_prdctfltr_force_emptyshop'] = get_option('wc_settings_prdctfltr_force_emptyshop', 'no');
     self::$settings['wc_settings']['product_taxonomies'] = get_object_taxonomies('product');
     if (self::$settings['wc_settings_prdctfltr_enable'] == 'yes') {
         add_filter('woocommerce_locate_template', array(&$this, 'prdctrfltr_add_loop_filter'), 10, 3);
         add_filter('wc_get_template_part', array(&$this, 'prdctrfltr_add_filter'), 10, 3);
     }
     if (self::$settings['wc_settings_prdctfltr_enable'] == 'no' && self::$settings['wc_settings_prdctfltr_default_templates'] == 'yes') {
         add_filter('woocommerce_locate_template', array(&$this, 'prdctrfltr_add_loop_filter_blank'), 10, 3);
         add_filter('wc_get_template_part', array(&$this, 'prdctrfltr_add_filter_blank'), 10, 3);
     }
     if (!is_admin() && self::$settings['wc_settings_prdctfltr_force_categories'] == 'no') {
         if (self::$settings['wc_settings_prdctfltr_force_redirects'] !== 'yes' && self::$settings['permalink_structure'] !== '') {
             add_action('template_redirect', array(&$this, 'prdctfltr_redirect'), 999);
         }
         if (self::$settings['wc_settings_prdctfltr_force_emptyshop'] !== 'yes') {
             add_action('template_redirect', array(&$this, 'prdctfltr_redirect_empty_shop'), 998);
         }
     }
     if (self::$settings['wc_settings_prdctfltr_use_ajax'] == 'yes') {
         add_filter('woocommerce_pagination_args', array(&$this, 'prdctfltr_pagination_filter'), 999, 1);
     }
     add_action('init', array(&$this, 'prdctfltr_text_domain'), 1000);
     add_action('wp_enqueue_scripts', array(&$this, 'prdctfltr_scripts'));
     add_filter('pre_get_posts', array(&$this, 'prdctfltr_wc_query'), 999999, 1);
     add_action('prdctfltr_output', array(&$this, 'prdctfltr_get_filter'), 10);
 }
예제 #3
0
파일: pf-settings.php 프로젝트: hikaram/wee
 public static function save_filters()
 {
     $key = isset($_POST['key']) ? $_POST['key'] : '';
     $filter = isset($_POST['filter']) ? $_POST['filter'] : '';
     $settings = isset($_POST['settings']) ? $_POST['settings'] : '';
     if ($key == '' || $filter == '' || $settings == '') {
         die;
         exit;
     }
     $language = WC_Prdctfltr::prdctfltr_wpml_language();
     if ($language !== false) {
         $key = $key . '_' . $language;
     }
     $alt['filter'] = $filter;
     if ($filter == 'price') {
         foreach ($settings as $set) {
             $alt['settings'][$set['min'] . '-' . $set['max']] = $set['text'];
         }
     } else {
         $alt['settings'] = $settings;
     }
     update_option($key, $alt);
     die('Updated!');
     exit;
 }
예제 #4
0
 function prdctfltr_price_filter($where, &$wp_query)
 {
     global $wpdb, $prdctfltr_global;
     $pf_activated = $prdctfltr_global['active_filters'];
     if (isset($pf_activated['sale_products']) && $pf_activated['sale_products'] == 'on') {
         $pf_sale = true;
         $pf_where_keys = array(array('_sale_price', '_min_variation_sale_price'), array('_sale_price', '_max_variation_sale_price'));
     } else {
         $pf_sale = false;
         $pf_where_keys = array(array('_price', '_min_variation_price'), array('_price', '_max_variation_price'));
     }
     if (isset($wp_query->query_vars['rng_min_price'])) {
         $_min_price = $wp_query->query_vars['rng_min_price'];
     }
     if (isset($wp_query->query_vars['min_price'])) {
         $_min_price = $wp_query->query_vars['min_price'];
     }
     if (isset($pf_activated['rng_min_price'])) {
         $_min_price = $pf_activated['rng_min_price'];
     }
     if (isset($pf_activated['min_price'])) {
         $_min_price = $pf_activated['min_price'];
     }
     if (!isset($_min_price)) {
         $prices = WC_Prdctfltr::get_filtered_price();
         $_min = floor($prices->min_price);
     }
     if (isset($wp_query->query_vars['rng_max_price'])) {
         $_max_price = $wp_query->query_vars['rng_max_price'];
     }
     if (isset($wp_query->query_vars['max_price'])) {
         $_max_price = $wp_query->query_vars['max_price'];
     }
     if (isset($pf_activated['rng_max_price'])) {
         $_max_price = $pf_activated['rng_max_price'];
     }
     if (isset($pf_activated['max_price'])) {
         $_max_price = $pf_activated['max_price'];
     }
     if (!isset($_max_price)) {
         $prices = !isset($prices) ? WC_Prdctfltr::get_filtered_price() : $prices;
         $_max = ceil($prices->max_price);
     }
     if ((isset($_min_price) || isset($_max_price)) !== false) {
         if (!isset($_min_price)) {
             $_min_price = $_min;
         }
         if (!isset($_max_price)) {
             $_max_price = $_max;
         }
         $where .= " AND ( ( pf_price.meta_key IN ('" . implode("','", array_map('esc_sql', $pf_where_keys[0])) . "') AND pf_price.meta_value >= {$_min_price} AND pf_price.meta_value <= {$_max_price} AND pf_price.meta_value != '' ) OR ( pf_price.meta_key IN ('" . implode("','", array_map('esc_sql', $pf_where_keys[1])) . "') AND pf_price.meta_value >= {$_min_price} AND pf_price.meta_value <= {$_max_price} AND pf_price.meta_value != '' ) ) ";
     } else {
         if ($pf_sale === true) {
             $where .= " AND ( pf_price.meta_key IN ('_sale_price','_min_variation_sale_price') AND pf_price.meta_value > 0 ) ";
         }
     }
     remove_filter('posts_where', 'prdctfltr_price_filter');
     return $where;
 }
<?php

if (!defined('ABSPATH')) {
    exit;
}
global $prdctfltr_global;
if (isset($prdctfltr_global['curr_options'])) {
    $curr_override = $prdctfltr_global['curr_options']['wc_settings_prdctfltr_noproducts'];
} else {
    $curr_options = WC_Prdctfltr::prdctfltr_get_settings();
    $curr_override = isset($prdctfltr_global['curr_options']['wc_settings_prdctfltr_noproducts']) ? $prdctfltr_global['curr_options']['wc_settings_prdctfltr_noproducts'] : '';
}
$curr_class = WC_Prdctfltr::$settings['wc_settings_prdctfltr_ajax_class'] == '' ? 'products' : WC_Prdctfltr::$settings['wc_settings_prdctfltr_ajax_class'];
echo '<div class="' . $curr_class . '">';
if ($curr_override == '') {
    wc_get_template('loop/no-products-found.php');
} else {
    echo do_shortcode($curr_override);
}
echo '</div>';
예제 #6
0
                                    if ($curr_fo['settings']['adoptive'] == 'yes' && isset($output_terms[$curr_fo['filter']]) && !empty($output_terms[$curr_fo['filter']]) && !array_key_exists($subsub->slug, $output_terms[$curr_fo['filter']])) {
                                        $pf_adoptive_class = ' pf_adoptive_hide';
                                    }
                                    $decode_slug = $subsub->slug;
                                    $curr_insert = $subsub->name . ($curr_options['wc_settings_prdctfltr_show_counts'] == 'no' || $term_count_real == '0' ? '' : ' <span class="prdctfltr_count">' . (isset($output_terms[$curr_fo['filter']]) && isset($output_terms[$curr_fo['filter']][$subsub->slug]) && $output_terms[$curr_fo['filter']][$subsub->slug] != $term_count_real ? WC_Prdctfltr::get_term_count($output_terms[$curr_fo['filter']][$subsub->slug], $term_count_real) : $term_count_real) . '</span>');
                                    printf('<label class="%6$s%4$s%7$s%8$s"><input type="checkbox" value="%1$s" %3$s /><span>%2$s</span>%5$s</label>', $decode_slug, $curr_insert, in_array($decode_slug, $curr_cat_selected) ? 'checked' : '', in_array($decode_slug, $curr_cat_selected) ? ' prdctfltr_active' : '', !empty($subsub->children) ? '<i class="prdctfltr-plus"></i>' : '', $pf_adoptive_class, !empty($subsub->children) && in_array($decode_slug, $curr_cat_selected) ? ' prdctfltr_clicked' : '', ' prdctfltr_ft_' . sanitize_title($subsub->slug));
                                    if (!empty($subsub->children)) {
                                        printf('<div class="prdctfltr_sub" data-sub="%1$s">', $subsub->slug);
                                        foreach ($subsub->children as $subsubsub) {
                                            $term_count_real = WC_Prdctfltr::published_term_count($subsubsub->term_id, $curr_fo['filter']);
                                            $pf_adoptive_class = '';
                                            if ($curr_fo['settings']['adoptive'] == 'yes' && isset($output_terms[$curr_fo['filter']]) && !empty($output_terms[$curr_fo['filter']]) && !array_key_exists($subsubsub->slug, $output_terms[$curr_fo['filter']])) {
                                                $pf_adoptive_class = ' pf_adoptive_hide';
                                            }
                                            $decode_slug = $subsubsub->slug;
                                            $curr_insert = $subsubsub->name . ($curr_options['wc_settings_prdctfltr_show_counts'] == 'no' || $term_count_real == '0' ? '' : ' <span class="prdctfltr_count">' . (isset($output_terms[$curr_fo['filter']]) && isset($output_terms[$curr_fo['filter']][$subsubsub->slug]) && $output_terms[$curr_fo['filter']][$subsubsub->slug] != $term_count_real ? WC_Prdctfltr::get_term_count($output_terms[$curr_fo['filter']][$subsubsub->slug], $term_count_real) : $term_count_real) . '</span>');
                                            printf('<label class="%5$s%4$s%6$s%7$s"><input type="checkbox" value="%1$s"%3$s /><span>%2$s</span></label>', $decode_slug, $curr_insert, in_array($decode_slug, $curr_cat_selected) ? ' checked' : '', in_array($decode_slug, $curr_cat_selected) ? ' prdctfltr_active' : '', $pf_adoptive_class, !empty($subsubsub->children) && in_array($decode_slug, $curr_cat_selected) ? ' prdctfltr_clicked' : '', ' prdctfltr_ft_' . sanitize_title($subsubsub->slug));
                                        }
                                        echo '</div>';
                                    }
                                }
                                echo '</div>';
                            }
                        }
                        echo '</div>';
                    }
                }
                ?>
								</div>
							</div>
					<?php 
예제 #7
0
    function form($instance)
    {
        $vars = array('preset' => 'pf_default', 'template' => '', 'disable_overrides' => 'no', 'widget_action' => '');
        $instance = wp_parse_args((array) $instance, $vars);
        $preset = strip_tags($instance['preset']);
        $template = strip_tags($instance['template']);
        $disable_overrides = strip_tags($instance['disable_overrides']);
        $widget_action = strip_tags($instance['widget_action']);
        ?>
			<div>
				<p class="prdctfltr-box">
					<label for="<?php 
        echo $this->get_field_id('preset');
        ?>
" class="prdctfltr-label"><?php 
        _e('Style', 'prdctfltr');
        ?>
 :</label>
					<select name="<?php 
        echo $this->get_field_name('preset');
        ?>
" id="<?php 
        echo $this->get_field_id('preset');
        ?>
" class="widefat">
						<option value="pf_default_inline"<?php 
        echo $preset == 'pf_default_inline' ? ' selected="selected"' : '';
        ?>
><?php 
        _e('Flat Inline', 'prdctfltr');
        ?>
</option>
						<option value="pf_default"<?php 
        echo $preset == 'pf_default' ? ' selected="selected"' : '';
        ?>
><?php 
        _e('Flat Block', 'prdctfltr');
        ?>
</option>
						<option value="pf_default_select"<?php 
        echo $preset == 'pf_default_select' ? ' selected="selected"' : '';
        ?>
><?php 
        _e('Flat Select', 'prdctfltr');
        ?>
</option>
					</select>
				</p>
				<p class="prdctfltr-box"> 
					<label for="<?php 
        echo $this->get_field_id('template');
        ?>
" class="prdctfltr-label"><?php 
        _e('Preset', 'prdctfltr');
        ?>
 :</label>
					<select name="<?php 
        echo $this->get_field_name('template');
        ?>
" id="<?php 
        echo $this->get_field_id('template');
        ?>
" class="widefat">
						<option value="default"<?php 
        echo $template == 'default' ? ' selected="selected"' : '';
        ?>
><?php 
        _e('Default', 'prdctfltr');
        ?>
</option>
					<?php 
        $curr_templates = get_option('prdctfltr_templates', array());
        foreach ($curr_templates as $k => $v) {
            ?>
						<option value="<?php 
            echo $k;
            ?>
"<?php 
            echo $template == $k ? ' selected="selected"' : '';
            ?>
><?php 
            echo $k;
            ?>
</option>
					<?php 
        }
        ?>
					</select>
				</p>
				<p class="prdctfltr-box">
					<label for="<?php 
        echo $this->get_field_id('disable_overrides');
        ?>
" class="prdctfltr-label"><?php 
        _e('Disable Overrides', 'prdctfltr');
        ?>
 :</label>
					<input type="checkbox" name="<?php 
        echo $this->get_field_name('disable_overrides');
        ?>
" id="<?php 
        echo $this->get_field_id('disable_overrides');
        ?>
" value="yes" <?php 
        echo $disable_overrides == 'yes' ? ' checked' : '';
        ?>
 />
				</p>
				<p class="prdctfltr-box">
					<label for="<?php 
        echo $this->get_field_id('widget_action');
        ?>
" class="prdctfltr-label"><?php 
        _e('Widget Action URL', 'prdctfltr');
        ?>
 :</label>
					<input type="text" name="<?php 
        echo $this->get_field_name('widget_action');
        ?>
" id="<?php 
        echo $this->get_field_id('widget_action');
        ?>
" value="<?php 
        echo $widget_action;
        ?>
" class="widefat" /><br/>
					<small><?php 
        _e('Custom action is used if the widget is not used in shop, product archives or pages with Product Filter shortcodes. This way you can redirect filtering to your shop page or a custom page. Enter URL to redirect. For example your shop page URL', 'prdctfltr');
        ?>
 <?php 
        echo get_permalink(WC_Prdctfltr::prdctfltr_wpml_get_id(woocommerce_get_page_id('shop')));
        ?>
</small>
				</p>

			</div>

	<?php 
    }
예제 #8
0
파일: prdctfltr.php 프로젝트: hikaram/wee
 function __construct()
 {
     self::$dir = trailingslashit(dirname(__FILE__));
     self::$path = trailingslashit(plugin_dir_path(__FILE__));
     self::$url_path = plugins_url(trailingslashit(basename(self::$dir)));
     self::$settings['permalink_structure'] = get_option('permalink_structure');
     self::$settings['wc_settings_prdctfltr_disable_scripts'] = get_option('wc_settings_prdctfltr_disable_scripts', array());
     self::$settings['wc_settings_prdctfltr_ajax_js'] = get_option('wc_settings_prdctfltr_ajax_js', '');
     self::$settings['wc_settings_prdctfltr_custom_tax'] = get_option('wc_settings_prdctfltr_custom_tax', 'no');
     self::$settings['wc_settings_prdctfltr_enable'] = get_option('wc_settings_prdctfltr_enable', 'yes');
     self::$settings['wc_settings_prdctfltr_enable_overrides'] = get_option('wc_settings_prdctfltr_enable_overrides', array('orderby', 'result-count'));
     foreach (self::$settings['wc_settings_prdctfltr_enable_overrides'] as $k => $v) {
         self::$settings['wc_settings_prdctfltr_enable_overrides'][$k] = 'loop/' . $v . '.php';
     }
     self::$settings['wc_settings_prdctfltr_enable_action'] = get_option('wc_settings_prdctfltr_enable_action', '');
     self::$settings['wc_settings_prdctfltr_default_templates'] = get_option('wc_settings_prdctfltr_default_templates', 'no');
     self::$settings['wc_settings_prdctfltr_force_categories'] = get_option('wc_settings_prdctfltr_force_categories', 'no');
     self::$settings['wc_settings_prdctfltr_instock'] = get_option('wc_settings_prdctfltr_instock', 'no');
     self::$settings['wc_settings_prdctfltr_use_ajax'] = get_option('wc_settings_prdctfltr_use_ajax', 'no');
     self::$settings['wc_settings_prdctfltr_ajax_class'] = get_option('wc_settings_prdctfltr_ajax_class', '');
     self::$settings['wc_settings_prdctfltr_ajax_category_class'] = get_option('wc_settings_prdctfltr_ajax_category_class', '');
     self::$settings['wc_settings_prdctfltr_ajax_product_class'] = get_option('wc_settings_prdctfltr_ajax_product_class', '');
     self::$settings['wc_settings_prdctfltr_ajax_pagination_class'] = get_option('wc_settings_prdctfltr_ajax_pagination_class', '');
     self::$settings['wc_settings_prdctfltr_ajax_columns'] = get_option('wc_settings_prdctfltr_ajax_columns', '4');
     self::$settings['wc_settings_prdctfltr_ajax_rows'] = get_option('wc_settings_prdctfltr_ajax_rows', '4');
     self::$settings['wc_settings_prdctfltr_force_redirects'] = get_option('wc_settings_prdctfltr_force_redirects', 'no');
     self::$settings['wc_settings_prdctfltr_force_emptyshop'] = get_option('wc_settings_prdctfltr_force_emptyshop', 'no');
     self::$settings['wc_settings_prdctfltr_use_analytics'] = get_option('wc_settings_prdctfltr_use_analytics', 'no');
     self::$settings['wc_settings_prdctfltr_shop_page_override'] = get_option('wc_settings_prdctfltr_shop_page_override', '');
     self::$settings['wc_settings']['product_taxonomies'] = get_object_taxonomies('product');
     if (self::$settings['wc_settings_prdctfltr_enable'] == 'yes') {
         add_filter('woocommerce_locate_template', array(&$this, 'prdctrfltr_add_loop_filter'), 10, 3);
         add_filter('wc_get_template_part', array(&$this, 'prdctrfltr_add_filter'), 10, 3);
     }
     if (self::$settings['wc_settings_prdctfltr_enable'] == 'no' && self::$settings['wc_settings_prdctfltr_default_templates'] == 'yes') {
         add_filter('woocommerce_locate_template', array(&$this, 'prdctrfltr_add_loop_filter_blank'), 10, 3);
         add_filter('wc_get_template_part', array(&$this, 'prdctrfltr_add_filter_blank'), 10, 3);
     }
     if (self::$settings['wc_settings_prdctfltr_enable'] == 'action' && self::$settings['wc_settings_prdctfltr_enable_action'] !== '') {
         $curr_action = explode(':', self::$settings['wc_settings_prdctfltr_enable_action']);
         if (isset($curr_action[1])) {
             $curr_action[1] = floatval($curr_action[1]);
         } else {
             $curr_action[1] = 10;
         }
         add_filter($curr_action[0], array(&$this, 'prdctfltr_get_filter'), $curr_action[1]);
     }
     if (!is_admin() && self::$settings['wc_settings_prdctfltr_force_categories'] == 'no') {
         if (self::$settings['wc_settings_prdctfltr_force_redirects'] !== 'yes' && self::$settings['permalink_structure'] !== '') {
             add_action('template_redirect', array(&$this, 'prdctfltr_redirect'), 999);
         }
         if (self::$settings['wc_settings_prdctfltr_force_emptyshop'] !== 'yes') {
             add_action('template_redirect', array(&$this, 'prdctfltr_redirect_empty_shop'), 998);
         }
     }
     if (self::$settings['wc_settings_prdctfltr_use_ajax'] == 'yes') {
         add_filter('woocommerce_pagination_args', array(&$this, 'prdctfltr_pagination_filter'), 999, 1);
     }
     add_action('init', array(&$this, 'prdctfltr_text_domain'), 1000);
     add_action('wp_enqueue_scripts', array(&$this, 'prdctfltr_scripts'));
     add_filter('pre_get_posts', array(&$this, 'prdctfltr_wc_query'), 999999, 1);
     add_action('prdctfltr_filter_after', array(&$this, 'prdctfltr_add_css'));
     add_action('wp', array(&$this, 'prdctfltr_init'));
     if (self::$settings['wc_settings_prdctfltr_use_analytics'] == 'yes') {
         add_action('wp_ajax_nopriv_prdctfltr_analytics', array(&$this, 'prdctfltr_analytics'));
         add_action('wp_ajax_prdctfltr_analytics', array(&$this, 'prdctfltr_analytics'));
     }
     add_action('prdctfltr_output', array(&$this, 'prdctfltr_get_filter'), 10);
 }
예제 #9
0
                            printf('<div class="prdctfltr_sub" data-sub="%1$s">', $sub->slug);
                            foreach ($sub->children as $subsub) {
                                $pf_adoptive_class = '';
                                if ($curr_options['wc_settings_prdctfltr_' . $attr . '_adoptive'] == 'yes' && isset($output_terms[$attr]) && !empty($output_terms[$attr]) && !array_key_exists($subsub->slug, $output_terms[$attr])) {
                                    $pf_adoptive_class = ' pf_adoptive_hide';
                                }
                                $decode_slug = WC_Prdctfltr::prdctfltr_utf8_decode($subsub->slug);
                                printf('<label class="%6$s%4$s%8$s"><input type="checkbox" value="%1$s" %3$s /><span>%2$s%7$s</span>%5$s</label>', $decode_slug, wc_attribute_label($subsub->name), in_array($decode_slug, $curr_selected) ? 'checked' : '', in_array($decode_slug, $curr_selected) ? ' prdctfltr_active' : '', !empty($subsub->children) ? '<i class="prdctfltr-plus"></i>' : '', $pf_adoptive_class, $curr_options['wc_settings_prdctfltr_show_counts'] == 'no' || $subsub->count == '0' ? '' : ' <span class="prdctfltr_count">' . (isset($output_terms[$attr]) && isset($output_terms[$attr][$subsub->slug]) && $output_terms[$attr][$subsub->slug] != $subsub->count ? $output_terms[$attr][$subsub->slug] . '/' . $subsub->count : $subsub->count) . '</span>', !empty($subsub->children) && in_array($decode_slug, $curr_selected) ? ' prdctfltr_clicked' : '');
                                if (!empty($subsub->children)) {
                                    printf('<div class="prdctfltr_sub" data-sub="%1$s">', $subsub->slug);
                                    foreach ($subsub->children as $subsubsub) {
                                        $pf_adoptive_class = '';
                                        if ($curr_options['wc_settings_prdctfltr_' . $attr . '_adoptive'] == 'yes' && isset($output_terms[$attr]) && !empty($output_terms[$attr]) && !array_key_exists($subsubsub->slug, $output_terms[$attr])) {
                                            $pf_adoptive_class = ' pf_adoptive_hide';
                                        }
                                        $decode_slug = WC_Prdctfltr::prdctfltr_utf8_decode($subsubsub->slug);
                                        printf('<label class="%5$s%4$s%7$s"><input type="checkbox" value="%1$s"%3$s /><span>%2$s%6$s</span></label>', $decode_slug, wc_attribute_label($subsubsub->name), in_array($decode_slug, $curr_selected) ? ' checked' : '', in_array($decode_slug, $curr_selected) ? ' prdctfltr_active' : '', $pf_adoptive_class, $curr_options['wc_settings_prdctfltr_show_counts'] == 'no' || $subsubsub->count == '0' ? '' : ' <span class="prdctfltr_count">' . (isset($output_terms[$attr]) && isset($output_terms[$attr][$subsubsub->slug]) && $output_terms[$attr][$subsubsub->slug] != $subsubsub->count ? $output_terms[$attr][$subsubsub->slug] . '/' . $subsubsub->count : $subsubsub->count) . '</span>', !empty($subsubsub->children) && in_array($decode_slug, $curr_selected) ? ' prdctfltr_clicked' : '');
                                    }
                                    echo '</div>';
                                }
                            }
                            echo '</div>';
                        }
                    }
                    echo '</div>';
                }
            }
            ?>
							</div>
						</div>
						<?php 
예제 #10
0
 /**
  * Shortcode AJAX Respond
  */
 function prdctfltr_respond()
 {
     global $prdctfltr_global;
     $shortcode_params = explode('|', $_POST['pf_shortcode']);
     $preset = $shortcode_params[0] !== 'false' ? $shortcode_params[0] : '';
     $columns = $shortcode_params[1] !== 'false' ? $shortcode_params[1] : 4;
     $rows = $shortcode_params[2] !== 'false' ? $shortcode_params[2] : 4;
     $pagination = $shortcode_params[3] !== 'false' ? $shortcode_params[3] : '';
     $no_products = $shortcode_params[4] !== 'false' ? $shortcode_params[4] : '';
     $show_products = $shortcode_params[5] !== 'false' ? $shortcode_params[5] : '';
     $use_filter = $shortcode_params[6] !== 'false' ? $shortcode_params[6] : '';
     $action = $shortcode_params[7] !== 'false' ? $shortcode_params[7] : '';
     $bot_margin = $shortcode_params[8] !== 'false' ? $shortcode_params[8] : '';
     $class = $shortcode_params[9] !== 'false' ? $shortcode_params[9] : '';
     $shortcode_id = $shortcode_params[10] !== 'false' ? $shortcode_params[10] : '';
     $disable_overrides = $shortcode_params[11] !== 'false' ? $shortcode_params[11] : '';
     $res_paged = isset($_POST['pf_paged']) ? $_POST['pf_paged'] : $_POST['pf_page'];
     $ajax_query = $_POST['pf_query'];
     $current_page = WC_Prdctfltr::prdctfltr_get_between($ajax_query, 'paged=', '&');
     $page = $res_paged;
     $args = str_replace('paged=' . $current_page . '&', 'paged=' . $page . '&', $ajax_query);
     $prdctfltr_global['ajax_query'] = $args;
     if ($no_products == 'yes') {
         $use_filter = 'no';
         $pagination = 'no';
         $orderby = 'rand';
     }
     $add_ajax = ' data-query="' . $args . '" data-page="' . $res_paged . '" data-shortcode="' . $_POST['pf_shortcode'] . '"';
     $bot_margin = (int) $bot_margin;
     $margin = " style='margin-bottom:" . $bot_margin . "px'";
     if (isset($_POST['pf_filters'])) {
         $curr_filters = $_POST['pf_filters'];
     } else {
         $curr_filters = array();
     }
     $filter_args = '';
     foreach ($curr_filters as $k => $v) {
         if (strpos($v, ',')) {
             $new_v = str_replace(',', '%2C', $v);
         } else {
             if (strpos($v, '+')) {
                 $new_v = str_replace('+', '%2B', $v);
             } else {
                 $new_v = $v;
             }
         }
         $filter_args .= '&' . $k . '=' . $new_v;
     }
     $args = $args . $filter_args;
     $prdctfltr_global['ajax_paged'] = $res_paged;
     $prdctfltr_global['active_filters'] = $curr_filters;
     if ($action !== '') {
         $prdctfltr_global['action'] = $action;
     }
     if ($preset !== '') {
         $prdctfltr_global['preset'] = $preset;
     }
     if ($disable_overrides !== '') {
         $prdctfltr_global['disable_overrides'] = $disable_overrides;
     }
     $out = '';
     global $woocommerce, $woocommerce_loop;
     $woocommerce_loop['columns'] = $columns;
     $prdctfltr_global['ajax'] = true;
     $prdctfltr_global['sc_ajax'] = $_POST['pf_mode'] == 'no' ? 'no' : null;
     $products = new WP_Query($args . '&prdctfltr=active');
     global $wp_the_query;
     $wp_the_query = $products;
     ob_start();
     if ($use_filter == 'yes') {
         include_once WC_Prdctfltr::$dir . 'woocommerce/loop/product-filter.php';
     }
     if ($products->have_posts()) {
         if ($show_products == 'yes') {
             woocommerce_product_loop_start();
             while ($products->have_posts()) {
                 $products->the_post();
                 wc_get_template_part('content', 'product');
             }
             woocommerce_product_loop_end();
         } else {
             $pagination = 'no';
         }
     } else {
         if ($_POST['pf_widget'] == 'yes') {
             $prdctfltr_global['widget_search'] = $_POST['pf_widget'];
             include_once WC_Prdctfltr::$dir . 'woocommerce/loop/product-filter.php';
         }
     }
     $prdctfltr_global['ajax'] = null;
     $shortcode = str_replace('type-product', 'product type-product', ob_get_clean());
     $out .= '<div' . ($shortcode_id != '' ? ' id="' . $shortcode_id . '"' : '') . ' class="prdctfltr_sc_products woocommerce prdctfltr_ajax' . ($class != '' ? ' ' . $class . '' : '') . '"' . $margin . $add_ajax . '>';
     $out .= do_shortcode($shortcode);
     if ($pagination == 'yes') {
         ob_start();
         add_filter('woocommerce_pagination_args', 'WC_Prdctfltr::prdctfltr_pagination_filter', 999, 1);
         wc_get_template('loop/pagination.php');
         remove_filter('woocommerce_pagination_args', 'WC_Prdctfltr::prdctfltr_pagination_filter');
         $pagination = ob_get_clean();
         $out .= $pagination;
     }
     if ($_POST['pf_widget'] == 'yes') {
         if (isset($_POST['pf_widget_title'])) {
             $curr_title = explode('%%%', $_POST['pf_widget_title']);
         }
         ob_start();
         the_widget('prdctfltr', 'preset=' . $_POST['pf_preset'] . '&template=' . $_POST['pf_template'], array('before_title' => stripslashes($curr_title[0]), 'after_title' => stripslashes($curr_title[1])));
         $out .= ob_get_clean();
     }
     $out .= '</div>';
     die($out);
     exit;
 }
예제 #11
0
             $curr_img = wp_get_attachment_image(get_woocommerce_term_meta($term->term_id, $curr_fo['filter'] . '_thumbnail_id_photo', true), 'shop_thumbnail');
             $curr_insert = $curr_img !== '' ? $curr_img : '<img src="' . WC_Prdctfltr::$url_path . '/lib/images/pf-placeholder.gif" />';
             $curr_insert .= $term->name . $term_count;
             break;
         case 'pf_attr_img':
             $curr_img = wp_get_attachment_image(get_woocommerce_term_meta($term->term_id, $curr_fo['filter'] . '_thumbnail_id_photo', true), 'shop_thumbnail');
             $curr_insert = $curr_img !== '' ? $curr_img : '<img src="' . WC_Prdctfltr::$url_path . '/lib/images/pf-placeholder.gif" />';
             $curr_insert .= '<span class="prdctfltr_tooltip"><span>' . $term->name . $term_count . '</span></span>';
             break;
         default:
             $curr_insert = $term->name;
             break;
     }
 } else {
     $term_count = $curr_options['wc_settings_prdctfltr_show_counts'] == 'no' || $term->count == '0' ? false : (isset($output_terms[$curr_fo['filter']]) && isset($output_terms[$curr_fo['filter']][$term->slug]) && $output_terms[$curr_fo['filter']][$term->slug] != $term->count ? $output_terms[$curr_fo['filter']][$term->slug] . '/' . $term->count : $term->count);
     $curr_insert = WC_Prdctfltr::get_customized_term($term->slug, $term->name, $term_count, $customization);
 }
 $pf_adoptive_class = '';
 if ($curr_fo['settings']['adoptive'] == 'yes' && isset($output_terms[$curr_fo['filter']]) && !empty($output_terms[$curr_fo['filter']]) && !array_key_exists($term->slug, $output_terms[$curr_fo['filter']])) {
     $pf_adoptive_class = ' pf_adoptive_hide';
 }
 printf('<label class="%6$s%4$s%7$s%8$s"><input type="checkbox" value="%1$s"%3$s /><span>%2$s</span>%5$s</label>', $decode_slug, $curr_insert, in_array($decode_slug, $curr_cat_selected) ? ' checked' : '', in_array($decode_slug, $curr_cat_selected) ? ' prdctfltr_active' : '', !empty($pf_children) ? '<i class="prdctfltr-plus"></i>' : '', $pf_adoptive_class, !empty($pf_children) && in_array($decode_slug, $curr_cat_selected) ? ' prdctfltr_clicked' : '', ' prdctfltr_ft_' . sanitize_title($term->slug));
 if (isset($curr_fo['settings']['hierarchy']) && $curr_fo['settings']['hierarchy'] == 'yes' && !empty($pf_children)) {
     printf('<div class="prdctfltr_sub" data-sub="%1$s">', $term->slug);
     foreach ($pf_children as $sub) {
         $pf_adoptive_class = '';
         if ($curr_fo['settings']['adoptive'] == 'yes' && isset($output_terms[$curr_fo['filter']]) && !empty($output_terms[$curr_fo['filter']]) && !array_key_exists($sub->slug, $output_terms[$curr_fo['filter']])) {
             $pf_adoptive_class = ' pf_adoptive_hide';
         }
         $decode_slug = $sub->slug;
         $curr_insert = $sub->name . ($curr_options['wc_settings_prdctfltr_show_counts'] == 'no' || $sub->count == '0' ? '' : ' <span class="prdctfltr_count">' . (isset($output_terms[$curr_fo['filter']]) && isset($output_terms[$curr_fo['filter']][$sub->slug]) && $output_terms[$curr_fo['filter']][$sub->slug] != $sub->count ? $output_terms[$curr_fo['filter']][$sub->slug] . '/' . $sub->count : $sub->count) . '</span>');
예제 #12
0
 public static function prdctfltr_respond_550()
 {
     if (!is_array($_POST)) {
         die(0);
         exit;
     }
     $set = array('pf_request' => array(), 'pf_requested' => array(), 'pf_filters' => array(), 'pf_mode' => 'archive', 'pf_widget_title' => null, 'pf_set' => 'shortcode', 'pf_paged' => '', 'pf_pagefilters' => array(), 'pf_shortcode' => null, 'pf_offset' => 0, 'pf_restrict' => '', 'pf_adds' => array(), 'pf_orderby_template' => null, 'pf_count_template' => null);
     $opt = array();
     foreach ($set as $k => $v) {
         if (isset($_POST[$k]) && $_POST[$k] !== '') {
             $opt[$k] = $_POST[$k];
         } else {
             $opt[$k] = $v;
         }
     }
     self::$settings['opt'] = $opt;
     $pf_request = isset($opt['pf_request']) ? $opt['pf_request'] : array();
     $pf_requested = isset($opt['pf_requested']) ? $opt['pf_requested'] : array();
     if (empty($pf_request) || empty($pf_requested)) {
         die(0);
         exit;
     }
     global $prdctfltr_global;
     $prdctfltr_global['pagefilters'] = $opt['pf_pagefilters'];
     $prdctfltr_global['unique_id'] = key($pf_requested);
     $active_filters = isset($opt['pf_filters']) && is_array($opt['pf_filters']) ? $opt['pf_filters'] : array();
     $curr_filters = array();
     foreach ($active_filters as $k => $v) {
         $curr_filters = array_merge($curr_filters, $v);
     }
     if ($opt['pf_set'] == 'shortcode') {
         $prdctfltr_global['sc_init'] = true;
         $prdctfltr_global['sc_query'] = $opt['pf_shortcode'];
         $prdctfltr_global['active_permalinks'] = $opt['pf_shortcode'];
         if (isset($prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['atts'])) {
             extract($prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['atts']);
             $prdctfltr_global['ajax_js'] = isset($prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['args']) ? $prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['args'] : array();
             $prdctfltr_global['ajax_atts'] = isset($prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['atts_sc']) ? $prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['atts_sc'] : array();
         } else {
             if (is_array($prdctfltr_global['pagefilters'])) {
                 $pf_pagefilters = $prdctfltr_global['pagefilters'];
                 reset($pf_pagefilters);
                 $sc_key = key($pf_pagefilters);
                 extract($prdctfltr_global['pagefilters'][$sc_key]['atts']);
                 $prdctfltr_global['ajax_js'] = isset($prdctfltr_global['pagefilters'][$sc_key]['args']) ? $prdctfltr_global['pagefilters'][$sc_key]['args'] : array();
                 $prdctfltr_global['ajax_atts'] = isset($prdctfltr_global['pagefilters'][$sc_key]['atts_sc']) ? $prdctfltr_global['pagefilters'][$sc_key]['atts_sc'] : array();
             }
         }
         $prdctfltr_global['sc_ajax'] = true;
         $prdctfltr_global['action'] = $action !== '' ? $action : '';
         $prdctfltr_global['preset'] = $preset !== '' ? $preset : '';
         $prdctfltr_global['disable_overrides'] = $disable_overrides == 'yes' ? 'yes' : 'no';
         $pagination_args = array('sc' => 'yes', 'ajax' => 'yes', 'type' => $pagination);
     } else {
         $prdctfltr_global['ajax_adds'] = $opt['pf_adds'];
         $pagination_args = array();
         $use_filter = 'yes';
     }
     if (!isset($prdctfltr_global['done_filters']) || $prdctfltr_global['done_filters'] !== true) {
         WC_Prdctfltr::make_global($curr_filters, 'AJAX');
     }
     $data = array();
     if ($opt['pf_mode'] == 'archive') {
         $query = self::make_query();
         if ($opt['pf_restrict'] !== 'pagination') {
             foreach ($pf_request as $filter => $options) {
                 if (in_array($filter, $pf_requested)) {
                     ob_start();
                     $prdctfltr_global['unique_id'] = $filter;
                     if ($options['widget_search'] !== 'yes') {
                         if ($use_filter == 'yes') {
                             include WC_Prdctfltr::$dir . 'woocommerce/loop/product-filter.php';
                         }
                     } else {
                         $widget_options = $opt['pf_request'][$filter]['widget_options'];
                         $defaults = array('style' => 'pf_default', 'preset' => '', 'disable_overrides' => 'no', 'action' => '');
                         foreach ($defaults as $k => $v) {
                             if (!isset($widget_options[$k])) {
                                 $widget_options[$k] = $v;
                             }
                         }
                         if (isset($opt['pf_widget_title'])) {
                             $curr_title = explode('%%%', $opt['pf_widget_title']);
                         }
                         the_widget('prdctfltr', 'preset=' . $widget_options['style'] . '&template=' . $widget_options['preset'] . '&disable_overrides=' . $widget_options['disable_overrides'], array('before_title' => stripslashes($curr_title[0]), 'after_title' => stripslashes($curr_title[1])));
                     }
                     $data[$filter] = ob_get_clean();
                 }
             }
         }
         $data['products'] = self::get_products($query);
         if (isset($prdctfltr_global['ranges'])) {
             $data['ranges'] = $prdctfltr_global['ranges'];
         }
         $data['pagination'] = self::get_pagination($pagination_args);
         if (isset($opt['pf_count_template'])) {
             global $wp_query;
             $wp_query = $query;
             if ($wp_query->found_posts > 0) {
                 ob_start();
                 woocommerce_result_count();
                 $data['count'] = ob_get_clean();
             } else {
                 $data['count'] = '';
             }
         }
         if (isset($opt['pf_orderby_template'])) {
             if (!isset($_GET['orderby']) && isset($prdctfltr_global['active_filters']['orderby'])) {
                 $_GET['orderby'] = $prdctfltr_global['active_filters']['orderby'];
             } else {
                 if (!isset($_GET['orderby'])) {
                     $_GET['orderby'] = 'date';
                 }
             }
             if (isset($_GET['orderby'])) {
                 $orderby = $_GET['orderby'];
                 ob_start();
                 woocommerce_catalog_ordering();
                 $data['orderby'] = ob_get_clean();
             }
         }
     }
     wp_send_json($data);
 }
예제 #13
0
 function woocommerce_get_product_thumbnail($size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0)
 {
     global $product;
     if ($product->is_type('variable')) {
         $attrs = array();
         foreach ($_GET as $k => $v) {
             if (substr($k, 0, 3) == 'pa_') {
                 if (strpos($v, ',')) {
                     $v_val = explode(',', $v);
                     $v_val = $v_val[0];
                 } else {
                     if (strpos($v, '+')) {
                         $v_val = explode('+', $v);
                         $v_val = $v_val[0];
                     } else {
                         $v_val = $v;
                     }
                 }
                 $attrs = $attrs + array($k => $v_val);
             }
         }
         if (count($attrs) == 0) {
             global $wp_the_query;
             if (isset($wp_the_query->query)) {
                 foreach ($wp_the_query->query as $k => $v) {
                     if (substr($k, 0, 3) == 'pa_') {
                         if (strpos($v, ',')) {
                             $v_val = explode(',', $v);
                             $v_val = $v_val[0];
                         } else {
                             if (strpos($v, '+')) {
                                 $v_val = explode('+', $v);
                                 $v_val = $v_val[0];
                             } else {
                                 $v_val = $v;
                             }
                         }
                         $attrs = $attrs + array($k => $v_val);
                     }
                 }
             }
         }
         if (count($attrs) == 0) {
             global $prdctfltr_global;
             if (isset($prdctfltr_global['active_filters'])) {
                 foreach ($prdctfltr_global['active_filters'] as $k => $v) {
                     if (substr($k, 0, 3) == 'pa_') {
                         if (strpos($v, ',')) {
                             $v_val = explode(',', $v);
                             $v_val = $v_val[0];
                         } else {
                             if (strpos($v, '+')) {
                                 $v_val = explode('+', $v);
                                 $v_val = $v_val[0];
                             } else {
                                 $v_val = $v;
                             }
                         }
                         $attrs = $attrs + array($k => $v_val);
                     }
                 }
             }
         }
         if (is_product_taxonomy()) {
             $attrs = array_merge($attrs, array(get_query_var('taxonomy') => get_query_var('term')));
         }
         if (count($attrs) > 0) {
             $curr_var = $product->get_available_variations();
             foreach ($curr_var as $key => $var) {
                 $curr_var_set[$key]['attributes'] = $var['attributes'];
                 $curr_var_set[$key]['variation_id'] = $var['variation_id'];
             }
             $found = WC_Prdctfltr::prdctrfltr_search_array($curr_var_set, $attrs);
         }
     }
     if (isset($found[0]) && $found[0]['variation_id'] && has_post_thumbnail($found[0]['variation_id'])) {
         $image = get_the_post_thumbnail($found[0]['variation_id'], $size);
     } elseif (has_post_thumbnail($product->id)) {
         $image = get_the_post_thumbnail($product->id, $size);
     } elseif (($parent_id = wp_get_post_parent_id($product->id)) && has_post_thumbnail($parent_id)) {
         $image = get_the_post_thumbnail($product, $size);
     } else {
         $image = wc_placeholder_img($size);
     }
     return $image;
 }
예제 #14
0
    public static function prdctfltr_get_settings($action = 'get')
    {
        $catalog_categories = get_terms('product_cat');
        $curr_cats = array();
        if (!empty($catalog_categories) && !is_wp_error($catalog_categories)) {
            foreach ($catalog_categories as $term) {
                $curr_cats[$term->slug] = $term->name;
            }
        }
        $catalog_tags = get_terms('product_tag');
        $curr_tags = array();
        if (!empty($catalog_tags) && !is_wp_error($catalog_tags)) {
            foreach ($catalog_tags as $term) {
                $curr_tags[$term->slug] = $term->name;
            }
        }
        $catalog_chars = taxonomy_exists('characteristics') ? get_terms('characteristics') : array();
        $curr_chars = array();
        if (!empty($catalog_chars) && !is_wp_error($catalog_chars)) {
            foreach ($catalog_chars as $term) {
                $curr_chars[$term->slug] = $term->name;
            }
        }
        $attribute_taxonomies = wc_get_attribute_taxonomies();
        $curr_atts = array();
        if (!empty($attribute_taxonomies) && !is_wp_error($attribute_taxonomies)) {
            foreach ($attribute_taxonomies as $term) {
                $curr_atts['pa_' . $term->attribute_name] = $term->attribute_name;
            }
        }
        if ($action == 'get') {
            ?>
		<ul class="subsubsub">
		<?php 
            $sections = array('presets' => __('Default Filter and Filter Presets', 'prdctfltr'), 'overrides' => __('Filter Overrides', 'prdctfltr'), 'advanced' => __('Advanced Options', 'prdctfltr'));
            $i = 0;
            foreach ($sections as $k => $v) {
                $curr_class = isset($_GET['section']) && $_GET['section'] == $k || !isset($_GET['section']) && $k == 'presets' ? ' class="current"' : '';
                printf('<li>%3$s<a href="%1$s"%3$s>%2$s</a></li>', admin_url('admin.php?page=wc-settings&tab=settings_products_filter&section=' . $k), $v, $i == 0 ? '' : ' | ', $curr_class);
                $i++;
            }
            printf('<li> | <a href="%1$s" target="_blank">%2$s</a></li>', 'http://codecanyon.net/user/dzeriho/portfolio?ref=dzeriho', __('Get more awesome plugins for WooCommerce!', 'prdctfltr'));
            ?>
		</ul>
		<br class="clear" />
		<?php 
        }
        if (isset($_GET['section']) && $_GET['section'] == 'advanced') {
            $curr_theme = wp_get_theme();
            $settings = array('section_general_title' => array('name' => __('Product Filter General Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('General Settings - These settings will affect all filters.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_general_title'), 'prdctfltr_enable' => array('name' => __('Enable/Disable Product Filter Template Overrides', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Uncheck this option in order to disable the Product Filter template override and use the default WooCommerce or', 'prdctfltr') . ' ' . $curr_theme->get('Name') . ' ' . __('theme filter. This options should be unchecked if you are using the widget version.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_enable', 'default' => 'yes'), 'prdctfltr_instock' => array('name' => __('Show In Stock Products by Default', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to show the In Stock products by default.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_instock', 'default' => 'no'), 'section_general_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_general_end'), 'section_ajax_title' => array('name' => __('Product Filter AJAX Product Archives Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('AJAX Product Archives Settings - Setup this section to use AJAX on shop and product archive pages.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_ajax_title'), 'prdctfltr_use_ajax' => array('name' => __('Use AJAX On Product Archives', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to use AJAX load on shop and product archive pages.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_use_ajax', 'default' => 'no'), 'prdctfltr_ajax_class' => array('name' => __('Override AJAX Wrapper Class', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter custom wrapper class if you are using a broken template and the default setting is not working. Default class: .products', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_ajax_class', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_ajax_product_class' => array('name' => __('Override AJAX Product Class', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter custom products class if you are using a broken template and the default setting is not working. Default class: .type-product', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_ajax_product_class', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_ajax_columns' => array('name' => __('AJAX Product Columns', 'prdctfltr'), 'type' => 'number', 'desc' => __('In how many columns are your product displayed on the shop and product archive pages by default?', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_ajax_columns', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_ajax_rows' => array('name' => __('AJAX Product Rows', 'prdctfltr'), 'type' => 'number', 'desc' => __('In how many rows are your product displayed on the shop and product archive pages by default?', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_ajax_rows', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'section_ajax_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_ajax_end'), 'section_advanced_title' => array('name' => __('Product Filter Advanced Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Advanced Settings - These settings will affect all filters.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_advanced_title'), 'prdctfltr_disable_display' => array('name' => __('Shop/Category Display Types And Product Filter', 'prdctfltr'), 'type' => 'multiselect', 'desc' => __('Select what display types will not show the Product Filter.  Use CTRL+Click to select multiple display types or deselect all.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_disable_display', 'options' => array('subcategories' => __('Show Categories', 'prdctfltr'), 'both' => __('Show Both', 'prdctfltr')), 'default' => array('subcategories'), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_shop_disable' => array('name' => __('Enable/Disable Shop Page Product Filter', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option in order to disable the Product Filter on Shop page. This option can be useful for themes with custom Shop pages, if checked the default WooCommerce or', 'prdctfltr') . ' ' . $curr_theme->get('Name') . ' ' . __('filter template will be overriden only on product archives that support it.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_shop_disable', 'default' => 'no'), 'prdctfltr_default_templates' => array('name' => __('Enable/Disable Default Filter Templates', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('If you have disabled the Product Filter Override Templates option at the top, then your default WooCommerce or', 'prdctfltr') . ' ' . $curr_theme->get('Name') . ' ' . __('filter templates will be shown. If you want do disable these default templates too, check this option. This option can be usefull for the widget version of the Product Filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_default_templates', 'default' => 'no'), 'prdctfltr_disable_scripts' => array('name' => __('Disable JavaScript Libraries', 'prdctfltr'), 'type' => 'multiselect', 'desc' => __('Select JavaScript libraries to disable. Use CTRL+Click to select multiple libraries or deselect all. Selected libraries will not be loaded.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_disable_scripts', 'options' => array('ionrange' => __('Ion Range Slider', 'prdctfltr'), 'isotope' => __('Isotope', 'prdctfltr'), 'mcustomscroll' => __('Malihu jQuery Scrollbar', 'prdctfltr')), 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_force_categories' => array('name' => __('Force Filtering thru Categories', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option if you are having issues with the redirects. This options should never be checked unless something is wrong with the template you are using. This option also limits your categories filter. The categories filter should not be used if this option is activated. (This option has changed since the 2.3.0 release. Now all installations should be compatible with the redirects by default. Test your installation before activating the option again)', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_force_categories', 'default' => 'no'), 'prdctfltr_force_product' => array('name' => __('Force Post Type Variable', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option if you are having issues with the searches. This options should never be checked unless something is wrong with the template you are using. Option will add the ?post_type=product parameter when filtering.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_force_product', 'default' => 'no'), 'prdctfltr_force_redirects' => array('name' => __('Disable Product Filter Redirects', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option if you are having issues with the shop page redirects.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_force_redirects', 'default' => 'no'), 'prdctfltr_force_emptyshop' => array('name' => __('Disable Empty Shop Redirects', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option if you are having issues with the shop page redirects.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_force_emptyshop', 'default' => 'no'), 'prdctfltr_use_variable_images' => array('name' => __('Use Variable Images', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to use variable images override on shop and archive pages. CAUTION This setting does not work on all servers by default. Additional server setup might be needed.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_use_variable_images', 'default' => 'no'), 'prdctfltr_ajax_js' => array('name' => __('AJAX jQuery and JS Refresh', 'prdctfltr'), 'type' => 'textarea', 'desc' => __('Input jQuery or JS code to execute after AJAX calls. This option is usefull if the JS is broken after these calls.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_ajax_js', 'default' => '', 'css' => 'min-width:600px;margin-top:12px;min-height:150px;'), 'section_advanced_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_advanced_end'));
        } else {
            if (isset($_GET['section']) && $_GET['section'] == 'presets' || !isset($_GET['section'])) {
                if ($action == 'get') {
                    printf('<h3>%1$s</h3><p>%2$s</p><p>', __('Product Filter Preset Manager', 'prdctfltr'), __('Manage filter presets. Load, delete and save presets. Saved filter presets can be used with shortcodes, filter overrides and widgets. Default filter preset will always be used unless the preset is specified by shortcode, filter override or the widget parameter.', 'prdctfltr'));
                    ?>
							<select id="prdctfltr_filter_presets">
								<option value="default"><?php 
                    _e('Default', 'wcwar');
                    ?>
</option>
								<?php 
                    $curr_presets = get_option('prdctfltr_templates');
                    if ($curr_presets === false) {
                        $curr_presets = array();
                    }
                    if (!empty($curr_presets)) {
                        foreach ($curr_presets as $k => $v) {
                            ?>
											<option value="<?php 
                            echo $k;
                            ?>
"><?php 
                            echo $k;
                            ?>
</option>
									<?php 
                        }
                    }
                    ?>
							</select>
			<?php 
                    printf('<a href="#" id="prdctfltr_save" class="button-primary">%1$s</a> <a href="#" id="prdctfltr_load" class="button-primary">%2$s</a> <a href="#" id="prdctfltr_delete" class="button-primary">%3$s</a> <a href="#" id="prdctfltr_reset_default" class="button-primary">%4$s</a> <a href="#" id="prdctfltr_save_default" class="button-primary">%5$s</a></p>', __('Save as preset', 'prdctfltr'), __('Load', 'prdctfltr'), __('Delete', 'prdctfltr'), __('Reset to default', 'prdctfltr'), __('Save as default preset', 'prdctfltr'));
                }
                $settings = array('section_basic_title' => array('name' => __('Filter Basic Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup you Product Filter appearance.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_basic_title'), 'prdctfltr_always_visible' => array('name' => __('Always Visible', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('This option will make Product Filter visible without the slide up/down animation at all times.', 'prdctfltr') . ' <em>' . __('(Does not work with the Arrow presets as these presets are absolutely positioned and the widget version)', 'prdctfltr') . '</em>', 'id' => 'wc_settings_prdctfltr_always_visible', 'default' => 'no'), 'prdctfltr_click_filter' => array('name' => __('Instant Filtering', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to disable the filter button and use instant product filtering.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_click_filter', 'default' => 'no'), 'prdctfltr_show_counts' => array('name' => __('Show Term Products Count', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to show products count with the terms.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_show_counts', 'default' => 'no'), 'prdctfltr_show_search' => array('name' => __('Show Term Search Fields', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to show search fields on supported terms.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_show_search', 'default' => 'no'), 'prdctfltr_adoptive' => array('name' => __('Enable/Disable Adoptive Filtering', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to enable the adoptive filtering.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_adoptive', 'default' => 'no'), 'prdctfltr_adoptive_style' => array('name' => __('Select Adoptive Filtering Style', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select style to use with the filtered terms.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_adoptive_style', 'options' => array('pf_adptv_default' => __('Hide Terms', 'prdctfltr'), 'pf_adptv_unclick' => __('Disabled and Unclickable', 'prdctfltr'), 'pf_adptv_click' => __('Disabled but Clickable', 'prdctfltr')), 'default' => 'pf_adptv_default', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_disable_bar' => array('name' => __('Disable Top Bar', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide the Product Filter top bar. This option will also make the filter always visible.', 'prdctfltr') . ' <em>' . __('(Does not work with the Arrow presets as these presets are absolutely positioned and the widget version)', 'prdctfltr') . '</em>', 'id' => 'wc_settings_prdctfltr_disable_bar', 'default' => 'no'), 'prdctfltr_disable_showresults' => array('name' => __('Disable Show Results Title', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide the show results text from the filter title.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_disable_showresults', 'default' => 'no'), 'prdctfltr_disable_sale' => array('name' => __('Disable Sale Button', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide the Product Filter sale button.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_disable_sale', 'default' => 'no'), 'prdctfltr_disable_instock' => array('name' => __('Disable In Stock Button', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide the Product Filter in stock button.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_disable_instock', 'default' => 'no'), 'prdctfltr_disable_reset' => array('name' => __('Disable Reset Button', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide the Product Filter reset button.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_disable_reset', 'default' => 'no'), 'prdctfltr_noproducts' => array('name' => __('Override No Products Action', 'prdctfltr'), 'type' => 'textarea', 'desc' => __('Input HTML/Shortcode to override the default action when no products are found. Default action means that random products will be shown when there are no products within the filter query.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_noproducts', 'default' => '', 'css' => 'min-width:600px;margin-top:12px;min-height:150px;'), 'section_basic_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_enable_end'), 'section_style_title' => array('name' => __('Filter Style', 'prdctfltr'), 'type' => 'title', 'desc' => __('Select style preset to use. Use custom preset for your own style. Use Disable CSS to disable all CSS for product filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_style_title'), 'prdctfltr_style_preset' => array('name' => __('Select Style', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select style. This option does not work with the widget version.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_style_preset', 'options' => array('pf_arrow' => __('Arrow', 'prdctfltr'), 'pf_arrow_inline' => __('Arrow Inline', 'prdctfltr'), 'pf_default' => __('Default', 'prdctfltr'), 'pf_default_inline' => __('Default Inline', 'prdctfltr'), 'pf_select' => __('Use Select Box', 'prdctfltr'), 'pf_sidebar' => __('Fixed Sidebar Left', 'prdctfltr'), 'pf_sidebar_right' => __('Fixed Sidebar Right', 'prdctfltr'), 'pf_sidebar_css' => __('Fixed Sidebar Left With Overlay', 'prdctfltr'), 'pf_sidebar_css_right' => __('Fixed Sidebar Righ With Overlay', 'prdctfltr'), 'pf_fullscreen' => __('Full Screen', 'prdctfltr')), 'default' => 'pf_default', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_style_mode' => array('name' => __('Select Mode', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select mode to use with the filter. This option does not work with the widget version.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_style_mode', 'options' => array('pf_mod_row' => __('One Row', 'prdctfltr'), 'pf_mod_multirow' => __('Multiple Rows', 'prdctfltr'), 'pf_mod_masonry' => __('Masonry Filters', 'prdctfltr')), 'default' => 'pf_mod_multirow', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_max_columns' => array('name' => __('Max Columns', 'prdctfltr'), 'type' => 'number', 'desc' => __('This option sets the number of columns for the filter. This option does not work with the widget version or the fixed sidebar layouts.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_max_columns', 'default' => 3, 'custom_attributes' => array('min' => 1, 'max' => 10, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_limit_max_height' => array('name' => __('Limit Max Height', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to limit the Max Height of for the filters.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_limit_max_height', 'default' => 'no'), 'prdctfltr_max_height' => array('name' => __('Max Height', 'prdctfltr'), 'type' => 'number', 'desc' => __('Set the Max Height value.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_max_height', 'default' => 150, 'custom_attributes' => array('min' => 100, 'max' => 300, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_custom_scrollbar' => array('name' => __('Use Custom Scroll Bars', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to override default browser scroll bars with javascrips scrollbars in Max Height mode.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_custom_scrollbar', 'default' => 'yes'), 'prdctfltr_style_checkboxes' => array('name' => __('Select Checkbox Style', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select style for the term checkboxes.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_style_checkboxes', 'options' => array('prdctfltr_round' => __('Round', 'prdctfltr'), 'prdctfltr_square' => __('Square', 'prdctfltr'), 'prdctfltr_checkbox' => __('Checkbox', 'prdctfltr'), 'prdctfltr_system' => __('System Checkboxes', 'prdctfltr')), 'default' => 'pf_round', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_style_hierarchy' => array('name' => __('Select Hierarchy Style', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select style for hierarchy terms.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_style_hierarchy', 'options' => array('prdctfltr_hierarchy_circle' => __('Circle', 'prdctfltr'), 'prdctfltr_hierarchy_filled' => __('Circle Solid', 'prdctfltr'), 'prdctfltr_hierarchy_lined' => __('Lined', 'prdctfltr'), 'prdctfltr_hierarchy_arrow' => __('Arrows', 'prdctfltr')), 'default' => 'prdctfltr_hierarchy_circle', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_button_position' => array('name' => __('Select Filter Buttons Position', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select position of the filter buttons (Filter selected, Sale button..).', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_button_position', 'options' => array('bottom' => __('Bottom', 'prdctfltr'), 'top' => __('Top', 'prdctfltr')), 'default' => 'bottom', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_icon' => array('name' => __('Override Filter Icon', 'prdctfltr'), 'type' => 'text', 'desc' => __('Input the icon class to override the default Product Filter icon. Use icon class e.g. prdctfltr-filter or FontAwesome fa fa-shopping-cart or any other.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_icon', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_title' => array('name' => __('Override Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Override Filter products, the default filter title.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_submit' => array('name' => __('Override Filter Submit Text', 'prdctfltr'), 'type' => 'text', 'desc' => __('Override Filter selected, the default filter submit button text.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_submit', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_loader' => array('name' => __('Select AJAX Loader Icon', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select AJAX loader icon.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_loader', 'options' => array('audio' => __('Audio', 'prdctfltr'), 'ball-triangle' => __('Ball Triangle', 'prdctfltr'), 'bars' => __('Bars', 'prdctfltr'), 'circles' => __('Circles', 'prdctfltr'), 'grid' => __('Grid', 'prdctfltr'), 'hearts' => __('Hearts', 'prdctfltr'), 'oval' => __('Oval', 'prdctfltr'), 'puff' => __('Puff', 'prdctfltr'), 'rings' => __('Rings', 'prdctfltr'), 'spinning-circles' => __('Spining Circles', 'prdctfltr'), 'tail-spin' => __('Tail Spin', 'prdctfltr'), 'circles' => __('Circles', 'prdctfltr'), 'three-dots' => __('Three Dots', 'prdctfltr')), 'default' => 'oval', 'css' => 'width:300px;margin-right:12px;'), 'section_style_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_style_end'), 'section_title' => array('name' => __('Select Filters', 'prdctfltr'), 'type' => 'title', 'desc' => __('Select filters to use on default template or current filter preset. For basic filters, shown in green and red depending on their use, the settings can be found bellow. Advanced and range filters, shown a blue, are set within the manager itself. Click and drag the filters to reorder.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_section_title'), 'prdctfltr_filters' => array('name' => __('Select Filters', 'prdctfltr'), 'type' => 'pf_filter', 'desc' => __('Select filters. Click on a filter to activate or create advanced filters. Click and drag to reorder filters.', 'prdctfltr')), 'section_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_section_end'), 'section_perpage_filter_title' => array('name' => __('Products Per Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup products per page filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_perpage_filter_title'), 'prdctfltr_perpage_title' => array('name' => __('Override Products Per Page Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the products per page filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_perpage_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_perpage_label' => array('name' => __('Override Products Per Page Filter Label', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter label for the products per page filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_perpage_label', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_perpage_range' => array('name' => __('Per Page Filter Initial', 'prdctfltr'), 'type' => 'number', 'desc' => __('Initial products per page value.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_perpage_range', 'default' => 20, 'custom_attributes' => array('min' => 3, 'max' => 999, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_perpage_range_limit' => array('name' => __('Per Page Filter Values', 'prdctfltr'), 'type' => 'number', 'desc' => __('Number of product per page values.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_perpage_range_limit', 'default' => 5, 'custom_attributes' => array('min' => 2, 'max' => 20, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'section_perpage_filter_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_perpage_filter_end'), 'section_instock_filter_title' => array('name' => __('In Stock Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup in stock filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_instock_filter_title'), 'prdctfltr_instock_title' => array('name' => __('Override In Stock Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the in stock filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_instock_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'section_instock_filter_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_instock_filter_end'), 'section_orderby_filter_title' => array('name' => __('Sort By Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup sort by filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_orderby_filter_title'), 'prdctfltr_orderby_title' => array('name' => __('Override Sort By Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the sort by filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_orderby_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_include_orderby' => array('name' => __('Select Sort By Terms', 'prdctfltr'), 'type' => 'multiselect', 'desc' => __('Select Sort by terms to include. Use CTRL+Click to select multiple Sort by terms or deselect all to use all Sort by terms.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_include_orderby', 'options' => array('menu_order' => __('Default', 'prdctfltr'), 'comment_count' => __('Review Count', 'prdctfltr'), 'popularity' => __('Popularity', 'prdctfltr'), 'rating' => __('Average rating', 'prdctfltr'), 'date' => __('Newness', 'prdctfltr'), 'price' => __('Price: low to high', 'prdctfltr'), 'price-desc' => __('Price: high to low', 'prdctfltr'), 'rand' => __('Random Products', 'prdctfltr'), 'title' => __('Product Name', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_orderby_none' => array('name' => __('Order By Hide None', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide None on order by filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_orderby_none', 'default' => 'no'), 'section_orderby_filter_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_orderby_filter_end'), 'section_price_filter_title' => array('name' => __('By Price Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup by price filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_price_filter_title'), 'prdctfltr_price_title' => array('name' => __('Override Price Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the price filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_price_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_price_range' => array('name' => __('Price Range Filter Initial Price', 'prdctfltr'), 'type' => 'number', 'desc' => __('Initial price for the filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_price_range', 'default' => 100, 'custom_attributes' => array('min' => 0.5, 'max' => 9999999, 'step' => 0.1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_price_range_add' => array('name' => __('Price Range Filter Price Add', 'prdctfltr'), 'type' => 'number', 'desc' => __('Price to add.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_price_range_add', 'default' => 100, 'custom_attributes' => array('min' => 0.5, 'max' => 9999999, 'step' => 0.1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_price_range_limit' => array('name' => __('Price Range Filter Intervals', 'prdctfltr'), 'type' => 'number', 'desc' => __('Number of price intervals to use. E.G. You have set the initial price to 99.9, and the add price is set to 100, you will achieve filtering like 0-99.9, 99.9-199.9, 199.9- 299.9 for the number of times as set in the price intervals setting.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_price_range_limit', 'default' => 6, 'custom_attributes' => array('min' => 2, 'max' => 20, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_price_none' => array('name' => __('Price Range Hide None', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide None on price filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_price_none', 'default' => 'no'), 'section_price_filter_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_price_filter_end'), 'section_cat_filter_title' => array('name' => __('By Category Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup by category filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_filter_title'), 'prdctfltr_cat_title' => array('name' => __('Override Category Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the category filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_include_cats' => array('name' => __('Select Categories', 'prdctfltr'), 'type' => 'multiselect', 'desc' => __('Select categories to include. Use CTRL+Click to select multiple categories or deselect all.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_include_cats', 'options' => $curr_cats, 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_cat_orderby' => array('name' => __('Categories Order By', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select the categories order.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_orderby', 'options' => array('' => __('None', 'prdctfltr'), 'id' => __('ID', 'prdctfltr'), 'name' => __('Name', 'prdctfltr'), 'slug' => __('Slug', 'prdctfltr'), 'count' => __('Count', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_cat_order' => array('name' => __('Categories Order', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select ascending or descending order.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_order', 'options' => array('ASC' => __('ASC', 'prdctfltr'), 'DESC' => __('DESC', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_cat_limit' => array('name' => __('Limit Categories', 'prdctfltr'), 'type' => 'number', 'desc' => __('Limit number of categories to be shown. If limit is set categories with most posts will be shown first.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_limit', 'default' => 0, 'custom_attributes' => array('min' => 0, 'max' => 100, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_cat_hierarchy' => array('name' => __('Use Category Hierarchy', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to enable category hierarchy.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_hierarchy', 'default' => 'no'), 'prdctfltr_cat_hierarchy_mode' => array('name' => __('Categories Hierarchy Mode', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to expand parent categories on load.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_hierarchy_mode', 'default' => 'no'), 'prdctfltr_cat_mode' => array('name' => __('Categories Hierarchy Filtering Mode', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select how to show categories upon filtering.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_mode', 'options' => array('showall' => __('Show all', 'prdctfltr'), 'subcategories' => __('Keep only parent and children categories', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_cat_multi' => array('name' => __('Use Multi Select', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to enable multi-select on categories.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_multi', 'default' => 'no'), 'prdctfltr_cat_relation' => array('name' => __('Multi Select Categories Relation', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select categories relation when multiple terms are selected.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_relation', 'options' => array('IN' => __('Filtered products have at least one term (IN)', 'prdctfltr'), 'AND' => __('Filtered products have selected terms (AND)', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_cat_adoptive' => array('name' => __('Use Adoptive Filtering', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to use adoptive filtering on categories.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_adoptive', 'default' => 'no'), 'prdctfltr_cat_none' => array('name' => __('Categories Hide None', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide None on categories.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_cat_none', 'default' => 'no'), 'section_cat_filter_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_cat_filter_end'), 'section_tag_filter_title' => array('name' => __('By Tag Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup by tag filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_filter_title'), 'prdctfltr_tag_title' => array('name' => __('Override Tag Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the tag filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_include_tags' => array('name' => __('Select Tags', 'prdctfltr'), 'type' => 'multiselect', 'desc' => __('Select tags to include. Use CTRL+Click to select multiple tags or deselect all.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_include_tags', 'options' => $curr_tags, 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_tag_orderby' => array('name' => __('Tags Order By', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select the tags order.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_orderby', 'options' => array('' => __('None', 'prdctfltr'), 'id' => __('ID', 'prdctfltr'), 'name' => __('Name', 'prdctfltr'), 'slug' => __('Slug', 'prdctfltr'), 'count' => __('Count', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_tag_order' => array('name' => __('Tags Order', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select ascending or descending order.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_order', 'options' => array('ASC' => __('ASC', 'prdctfltr'), 'DESC' => __('DESC', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_tag_limit' => array('name' => __('Limit Tags', 'prdctfltr'), 'type' => 'number', 'desc' => __('Limit number of tags to be shown. If limit is set tags with most posts will be shown first.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_limit', 'default' => 0, 'custom_attributes' => array('min' => 0, 'max' => 100, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_tag_multi' => array('name' => __('Use Multi Select', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to enable multi-select on tags.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_multi', 'default' => 'no'), 'prdctfltr_tag_relation' => array('name' => __('Multi Select Tags Relation', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select tags relation when multiple terms are selected.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_relation', 'options' => array('IN' => __('Filtered products have at least one term (IN)', 'prdctfltr'), 'AND' => __('Filtered products have selected terms (AND)', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_tag_adoptive' => array('name' => __('Use Adoptive Filtering', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to use adoptive filtering on tags.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_adoptive', 'default' => 'no'), 'prdctfltr_tag_none' => array('name' => __('Tags Hide None', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide None on tags.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_tag_none', 'default' => 'no'), 'section_tag_filter_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_tag_filter_end'), 'section_char_filter_title' => array('name' => __('By Characteristics Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Setup by characteristics filter.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_char_filter_title'), 'prdctfltr_custom_tax' => array('name' => __('Use Characteristics', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Enable this option to get custom characteristics product meta box.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_custom_tax', 'default' => 'yes'), 'prdctfltr_custom_tax_title' => array('name' => __('Override Characteristics Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the characteristics filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_custom_tax_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_include_chars' => array('name' => __('Select Characteristics', 'prdctfltr'), 'type' => 'multiselect', 'desc' => __('Select characteristics to include. Use CTRL+Click to select multiple characteristics or deselect all.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_include_chars', 'options' => $curr_chars, 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_custom_tax_orderby' => array('name' => __('Characteristics Order By', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select the characteristics order.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_custom_tax_orderby', 'options' => array('' => __('None', 'prdctfltr'), 'id' => __('ID', 'prdctfltr'), 'name' => __('Name', 'prdctfltr'), 'slug' => __('Slug', 'prdctfltr'), 'count' => __('Count', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_custom_tax_order' => array('name' => __('Characteristics Order', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select ascending or descending order.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_custom_tax_order', 'options' => array('ASC' => __('ASC', 'prdctfltr'), 'DESC' => __('DESC', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_custom_tax_limit' => array('name' => __('Limit Characteristics', 'prdctfltr'), 'type' => 'number', 'desc' => __('Limit number of characteristics to be shown. If limit is set characteristics with most posts will be shown first.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_custom_tax_limit', 'default' => 0, 'custom_attributes' => array('min' => 0, 'max' => 100, 'step' => 1), 'css' => 'width:100px;margin-right:12px;'), 'prdctfltr_chars_multi' => array('name' => __('Use Multi Select', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to enable multi-select on characteristics.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_chars_multi', 'default' => 'no'), 'prdctfltr_custom_tax_relation' => array('name' => __('Multi Select Characteristics Relation', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select characteristics relation when multiple terms are selected.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_custom_tax_relation', 'options' => array('IN' => __('Filtered products have at least one term (IN)', 'prdctfltr'), 'AND' => __('Filtered products have selected terms (AND)', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_chars_adoptive' => array('name' => __('Use Adoptive Filtering', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to use adoptive filtering on characteristics.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_chars_adoptive', 'default' => 'no'), 'prdctfltr_chars_none' => array('name' => __('Characteristics Hide None', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide None on characteristics.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_chars_none', 'default' => 'no'), 'section_char_filter_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_char_filter_end'));
                if ($attribute_taxonomies) {
                    $settings = $settings + array();
                    foreach ($attribute_taxonomies as $tax) {
                        $catalog_attrs = get_terms('pa_' . $tax->attribute_name);
                        $curr_attrs = array();
                        if (!empty($catalog_attrs) && !is_wp_error($catalog_attrs)) {
                            foreach ($catalog_attrs as $term) {
                                $curr_attrs[WC_Prdctfltr::prdctfltr_utf8_decode($term->slug)] = $term->name;
                            }
                        }
                        $tax->attribute_label = !empty($tax->attribute_label) ? $tax->attribute_label : $tax->attribute_name;
                        $settings = $settings + array('section_pa_' . $tax->attribute_name . '_title' => array('name' => __('By', 'prdctfltr') . ' ' . $tax->attribute_label . ' ' . __('Filter Settings', 'prdctfltr'), 'type' => 'title', 'desc' => __('Select options for the current attribute.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_title'), 'prdctfltr_pa_' . $tax->attribute_name . '_title' => array('name' => __('Override ' . $tax->attribute_label . ' Filter Title', 'prdctfltr'), 'type' => 'text', 'desc' => __('Enter title for the characteristics filter. If you leave this field blank default will be used.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_title', 'default' => '', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_include_pa_' . $tax->attribute_name => array('name' => __('Select Terms', 'prdctfltr'), 'type' => 'multiselect', 'desc' => __('Select terms to include. Use CTRL+Click to select multiple terms or deselect all.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_include_pa_' . $tax->attribute_name, 'options' => $curr_attrs, 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_pa_' . $tax->attribute_name . '_orderby' => array('name' => __('Terms Order By', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select the term order.', 'prdctfltr'), 'id' => 'wc_settings_pa_' . $tax->attribute_name . '_orderby', 'options' => array('' => __('None', 'prdctfltr'), 'id' => __('ID', 'prdctfltr'), 'name' => __('Name', 'prdctfltr'), 'slug' => __('Slug', 'prdctfltr'), 'count' => __('Count', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_pa_' . $tax->attribute_name . '_order' => array('name' => __('Terms Order', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select ascending or descending order.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_order', 'options' => array('ASC' => __('ASC', 'prdctfltr'), 'DESC' => __('DESC', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_pa_' . $tax->attribute_name => array('name' => __('Appearance', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select style preset to use with the current attribute.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name, 'options' => array('pf_attr_text' => __('Text', 'prdctfltr'), 'pf_attr_imgtext' => __('Thumbnails with text', 'prdctfltr'), 'pf_attr_img' => __('Thumbnails only', 'prdctfltr')), 'default' => 'pf_attr_text', 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_pa_' . $tax->attribute_name . '_hierarchy' => array('name' => __('Use Attribute Hierarchy', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to enable attribute hierarchy.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_hierarchy', 'default' => 'no'), 'prdctfltr_pa_' . $tax->attribute_name . '_multi' => array('name' => __('Use Multi Select', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to enable multi-select on current attribute.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_multi', 'default' => 'no'), 'prdctfltr_pa_' . $tax->attribute_name . '_relation' => array('name' => __('Multi Select Terms Relation', 'prdctfltr'), 'type' => 'select', 'desc' => __('Select terms relation when multiple terms are selected.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_relation', 'options' => array('IN' => __('Filtered products have at least one term (IN)', 'prdctfltr'), 'AND' => __('Filtered products have selected terms (AND)', 'prdctfltr')), 'default' => array(), 'css' => 'width:300px;margin-right:12px;'), 'prdctfltr_pa_' . $tax->attribute_name . '_adoptive' => array('name' => __('Use Adoptive Filtering', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to use adoptive filtering on current attribute.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_adoptive', 'default' => 'no'), 'prdctfltr_pa_' . $tax->attribute_name . '_none' => array('name' => __('Hide None', 'prdctfltr'), 'type' => 'checkbox', 'desc' => __('Check this option to hide None on current attribute.', 'prdctfltr'), 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_none', 'default' => 'no'), 'section_pa_' . $tax->attribute_name . '_end' => array('type' => 'sectionend', 'id' => 'wc_settings_prdctfltr_pa_' . $tax->attribute_name . '_end'));
                    }
                }
            } else {
                if (isset($_GET['section']) && $_GET['section'] == 'overrides') {
                    $settings = array();
                    if ($action == 'get') {
                        $curr_or_settings = get_option('prdctfltr_overrides', array());
                        ?>
					<h3><?php 
                        _e('Product Filter Shop Archives Override', 'prdctfltr');
                        ?>
</h3>
					<p><?php 
                        _e('Override archive filters. Select the term you wish to override and the desired filter preset and click Add Override to enable the new filter preset on this archive page.', 'prdctfltr');
                        ?>
</p>
				<?php 
                        $curr_overrides = array('product_cat' => array('text' => __('Product Categories Overrides', 'prdctfltr'), 'values' => $curr_cats), 'product_tag' => array('text' => __('Product Tags Overrides', 'prdctfltr'), 'values' => $curr_tags), 'characteristics' => array('text' => __('Product Characteristics Overrides', 'prdctfltr'), 'values' => $curr_chars));
                        foreach ($curr_overrides as $n => $m) {
                            if (empty($m['values'])) {
                                continue;
                            }
                            ?>
						<h3><?php 
                            echo $m['text'];
                            ?>
</h3>
						<p class="<?php 
                            echo $n;
                            ?>
">
						<?php 
                            if (isset($curr_or_settings[$n])) {
                                foreach ($curr_or_settings[$n] as $k => $v) {
                                    ?>
							<span class="prdctfltr_override"><input type="checkbox" class="pf_override_checkbox" /> <?php 
                                    echo __('Term slug', 'prdctfltr') . ' : <span class="slug">' . $k . '</span>';
                                    ?>
 <?php 
                                    echo __('Filter Preset', 'prdctfltr') . ' : <span class="preset">' . $v;
                                    ?>
</span> <a href="#" class="button prdctfltr_or_remove"><?php 
                                    _e('Remove Override', 'prdctfltr');
                                    ?>
</a><span class="clearfix"></span></span>
							<?php 
                                }
                            }
                            ?>
							<span class="prdctfltr_override_controls">
								<a href="#" class="button prdctfltr_or_remove_selected"><?php 
                            _e('Remove Selected Overrides', 'prdctfltr');
                            ?>
</a> <a href="#" class="button prdctfltr_or_remove_all"><?php 
                            _e('Remove All Overrides', 'prdctfltr');
                            ?>
</a>
							</span>
							<select class="prdctfltr_or_select">
						<?php 
                            foreach ($m['values'] as $k => $v) {
                                printf('<option value="%1$s">%2$s</option>', $k, $v);
                            }
                            ?>
							</select>
							<select class="prdctfltr_filter_presets">
								<option value="default"><?php 
                            _e('Default', 'wcwar');
                            ?>
</option>
								<?php 
                            $curr_presets = get_option('prdctfltr_templates');
                            if ($curr_presets === false) {
                                $curr_presets = array();
                            }
                            if (!empty($curr_presets)) {
                                foreach ($curr_presets as $k => $v) {
                                    ?>
											<option value="<?php 
                                    echo $k;
                                    ?>
"><?php 
                                    echo $k;
                                    ?>
</option>
									<?php 
                                }
                            }
                            ?>
							</select>
							<a href="#" class="button-primary prdctfltr_or_add"><?php 
                            _e('Add Override', 'prdctfltr');
                            ?>
</a>
						</p>
				<?php 
                        }
                    }
                }
            }
        }
        return apply_filters('wc_settings_products_filter_settings', $settings);
    }