public function wp_head() { global $wp_query; //*** $request_data = $this->get_request_data(); if (!isset($wp_query->query_vars['taxonomy']) and !defined('DOING_AJAX')) { $this->set_really_current_term(); } //*** ?> <?php //if (isset($this->settings['custom_css_code'])): ?> <style type="text/css"> <?php if (isset($this->settings['custom_css_code'])) { echo stripcslashes($this->settings['custom_css_code']); } ?> <?php if (isset($this->settings['overlay_skin_bg_img'])) { if (!empty($this->settings['overlay_skin_bg_img'])) { ?> .plainoverlay { background-image: url('<?php echo $this->settings['overlay_skin_bg_img']; ?> '); } <?php } } //*** if (isset($this->settings['plainoverlay_color'])) { if (!empty($this->settings['plainoverlay_color'])) { ?> .jQuery-plainOverlay-progress { border-top: 12px solid <?php echo $this->settings['plainoverlay_color']; ?> !important; } <?php } } //*** if (isset($this->settings['woof_auto_subcats_plus_img'])) { if (!empty($this->settings['woof_auto_subcats_plus_img'])) { ?> .woof_childs_list_opener span.woof_is_closed{ background: url(<?php echo $this->settings['woof_auto_subcats_plus_img']; ?> ) !important; } <?php } } if (isset($this->settings['woof_auto_subcats_minus_img'])) { if (!empty($this->settings['woof_auto_subcats_minus_img'])) { ?> .woof_childs_list_opener span.woof_is_opened{ background: url(<?php echo $this->settings['woof_auto_subcats_minus_img']; ?> ) !important; } <?php } } ?> <?php if (isset($this->settings['by_price']['show_button'])) { //just for compatibility from 2.1.2 to 2.1.3 $show_price_search_button = (int) $this->settings['by_price']['show_button']; } else { $show_price_search_button = (int) get_option('woof_show_price_search_button', 0); } if ($show_price_search_button == 1) { ?> <?php } else { ?> /***** START: hiding submit button of the price slider ******/ .woof_price_search_container .price_slider_amount button.button{ display: none; } .woof_price_search_container .price_slider_amount .price_label{ text-align: left !important; } .woof .widget_price_filter .price_slider_amount .button { float: left; } /***** END: hiding submit button of the price slider ******/ <?php } ?> </style> <?php //endif; ?> <?php if (!current_user_can('create_users')) { ?> <style type="text/css"> .woof_edit_view{ display: none; } </style> <?php } ?> <script type="text/javascript"> if (typeof woof_lang_custom == 'undefined') { var woof_lang_custom = {};//!!important } //*** var woof_is_mobile = 0; <?php if (WOOF_HELPER::is_mobile_device()) { ?> woof_is_mobile = 1; <?php } ?> var woof_is_permalink =<?php echo intval((bool) $this->is_permalink_activated()); ?> ; var woof_shop_page = ""; <?php if (!$this->is_permalink_activated()) { ?> woof_shop_page = "<?php echo home_url('/?post_type=product'); ?> "; <?php } ?> var woof_really_curr_tax = {}; var woof_show_price_search_button = 0; <?php if (isset($this->settings['by_price']['show_button'])) { //just for compatibility from 2.1.2 to 2.1.3 $show_price_search_button = (int) $this->settings['by_price']['show_button']; } else { $show_price_search_button = (int) get_option('woof_show_price_search_button', 0); } if ($show_price_search_button == 1) { ?> woof_show_price_search_button = 1; <?php } ?> var swoof_search_slug = "<?php echo $this->get_swoof_search_slug(); ?> "; <?php $icheck_skin = 'none'; if (isset($this->settings['icheck_skin'])) { $icheck_skin = $this->settings['icheck_skin']; } ?> var icheck_skin = {}; <?php if ($icheck_skin != 'none') { ?> <?php $icheck_skin = explode('_', $icheck_skin); ?> icheck_skin.skin = "<?php echo $icheck_skin[0]; ?> "; icheck_skin.color = "<?php echo $icheck_skin[1]; ?> "; <?php } else { ?> icheck_skin = 'none'; <?php } ?> var is_woof_use_chosen =<?php echo $this->is_woof_use_chosen(); ?> ; var woof_current_page_link = location.protocol + '//' + location.host + location.pathname; //***lets remove pagination from woof_current_page_link woof_current_page_link = woof_current_page_link.replace(/\page\/[0-9]+/, ""); <?php if (!isset($wp_query->query_vars['taxonomy'])) { $page_id = get_option('woocommerce_shop_page_id'); if ($page_id > 0) { if (!$this->is_permalink_activated()) { $link = home_url('/?post_type=product'); } else { $link = get_permalink($page_id); } } if (is_string($link) and !empty($link)) { ?> woof_current_page_link = "<?php echo $link; ?> "; <?php } } //code bone when filter child categories on the category page of parent //like here: http://dev.pluginus.net/product-category/clothing/?swoof=1&product_cat=hoo1 if (!defined('DOING_AJAX') and !is_page()) { if (isset($wp_query->query_vars['taxonomy']) and empty($request_data)) { $queried_obj = get_queried_object(); if (is_object($queried_obj)) { //$_SESSION['woof_really_current_term'] = $queried_obj; $this->set_really_current_term($queried_obj); ?> woof_really_curr_tax = {term_id:<?php echo $queried_obj->term_id; ?> , taxonomy: "<?php echo $queried_obj->taxonomy; ?> "}; <?php } } } else { if ($this->is_really_current_term_exists()) { //unset($_SESSION['woof_really_current_term']); $this->set_really_current_term(); } } //+++ $woof_use_beauty_scroll = (int) get_option('woof_use_beauty_scroll', 0); ?> var woof_link = '<?php echo WOOF_LINK; ?> '; var woof_current_values = '<?php echo json_encode($this->get_request_data()); ?> '; //+++ var woof_lang_loading = "<?php _e('Loading ...', 'woocommerce-products-filter'); ?> "; <?php if (isset($this->settings['default_overlay_skin_word']) and !empty($this->settings['default_overlay_skin_word'])) { ?> woof_lang_loading = "<?php echo __($this->settings['default_overlay_skin_word'], 'woocommerce-products-filter'); ?> "; <?php } ?> var woof_lang_show_products_filter = "<?php _e('show products filter', 'woocommerce-products-filter'); ?> "; var woof_lang_hide_products_filter = "<?php _e('hide products filter', 'woocommerce-products-filter'); ?> "; var woof_lang_pricerange = "<?php _e('price range', 'woocommerce-products-filter'); ?> "; var woof_lang = { 'orderby': "<?php _e('orderby', 'woocommerce-products-filter'); ?> ", 'perpage': "<?php _e('Per page', 'woocommerce-products-filter'); ?> ", 'pricerange': "<?php _e('price range', 'woocommerce-products-filter'); ?> " }; var woof_use_beauty_scroll =<?php echo $woof_use_beauty_scroll; ?> ; //+++ var woof_autosubmit =<?php echo (int) get_option('woof_autosubmit', 0); ?> ; var woof_ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?> "; var woof_submit_link = ""; var woof_is_ajax = 0; var woof_ajax_redraw = 0; var woof_ajax_page_num =<?php echo get_query_var('page') ? get_query_var('page') : 1; ?> ; var woof_ajax_first_done = false; var woof_checkboxes_slide_flag = <?php echo (int) get_option('woof_checkboxes_slide') == 1 ? 'true' : 'false'; ?> ; //indexes which can be displayed in red buttons panel <?php $taxonomies = $this->get_taxonomies(); $taxonomies_keys = array_keys($taxonomies); array_walk($taxonomies_keys, create_function('&$str', '$str = "\\"$str\\"";')); $taxonomies_keys = implode(',', $taxonomies_keys); $extensions_html_type_indexes = array(); if (!empty(WOOF_EXT::$includes['html_type_objects'])) { foreach (WOOF_EXT::$includes['html_type_objects'] as $obj) { if ($obj->index !== NULL) { $extensions_html_type_indexes[] = $obj->index; } } } array_walk($extensions_html_type_indexes, create_function('&$str', '$str = "\\"$str\\"";')); $extensions_html_type_indexes = implode(',', $extensions_html_type_indexes); ?> var woof_accept_array = ["min_price", "orderby", "perpage", <?php echo $extensions_html_type_indexes; ?> ,<?php echo $taxonomies_keys; ?> ]; <?php if (isset($request_data['really_curr_tax'])) { ?> <?php $tmp = explode('-', $request_data['really_curr_tax']); ?> woof_really_curr_tax = {term_id:<?php echo $tmp[0]; ?> , taxonomy: "<?php echo $tmp[1]; ?> "}; <?php } ?> var woof_overlay_skin = "<?php echo isset($this->settings['overlay_skin']) ? $this->settings['overlay_skin'] : 'default'; ?> "; jQuery(function () { woof_current_values = jQuery.parseJSON(woof_current_values); if (woof_current_values.length == 0) { woof_current_values = {}; } }); //*** //for extensions var woof_ext_init_functions = null; <?php if (!empty(WOOF_EXT::$includes['js_init_functions'])) { ?> woof_ext_init_functions = '<?php echo json_encode(WOOF_EXT::$includes['js_init_functions']); ?> '; <?php } ?> //*** function woof_js_after_ajax_done() { <?php echo isset($this->settings['js_after_ajax_done']) ? stripcslashes($this->settings['js_after_ajax_done']) : ''; ?> } </script> <?php if ($icheck_skin != 'none') { wp_enqueue_script('icheck-jquery', WOOF_LINK . 'js/icheck/icheck.min.js', array('jquery')); //wp_enqueue_style('icheck-jquery', self::get_application_uri() . 'js/icheck/all.css'); } /* if (is_shop()) { add_action('woocommerce_before_shop_loop', array($this, 'woocommerce_before_shop_loop')); } */ //*** //wp_enqueue_script('md5', WOOF_LINK . 'js/jquery.md5.js', array('jquery')); //wp_enqueue_script('masonry', WOOF_LINK . 'js/jquery.masonry.min.js', array('jquery')); wp_enqueue_script('woof_front', WOOF_LINK . 'js/front.js', array('jquery')); wp_enqueue_script('woof_radio_html_items', WOOF_LINK . 'js/html_types/radio.js', array('jquery')); wp_enqueue_script('woof_checkbox_html_items', WOOF_LINK . 'js/html_types/checkbox.js', array('jquery')); wp_enqueue_script('woof_select_html_items', WOOF_LINK . 'js/html_types/select.js', array('jquery')); wp_enqueue_script('woof_mselect_html_items', WOOF_LINK . 'js/html_types/mselect.js', array('jquery')); //for extensions if (!empty(WOOF_EXT::$includes['js'])) { foreach (WOOF_EXT::$includes['js'] as $js_key => $js_link) { wp_enqueue_script($js_key, $js_link, array('jquery')); } } //+++ if ($this->is_woof_use_chosen()) { wp_enqueue_script('chosen-drop-down', WOOF_LINK . 'js/chosen/chosen.jquery.min.js', array('jquery')); } if (isset($this->settings['overlay_skin']) and $this->settings['overlay_skin'] != 'default') { wp_enqueue_script('plainoverlay', WOOF_LINK . 'js/plainoverlay/jquery.plainoverlay.min.js', array('jquery')); } if ($woof_use_beauty_scroll) { wp_enqueue_script('mousewheel', WOOF_LINK . 'js/malihu-custom-scrollbar/jquery.mousewheel.min.js', array('jquery')); wp_enqueue_script('malihu-custom-scrollbar', WOOF_LINK . 'js/malihu-custom-scrollbar/jquery.mCustomScrollbar.min.js', array('jquery')); wp_enqueue_script('malihu-custom-scrollbar-concat', WOOF_LINK . 'js/malihu-custom-scrollbar/jquery.mCustomScrollbar.concat.min.js', array('jquery')); } if (isset($this->settings['by_price']['show'])) { //just for compatibility from 2.1.2 to 2.1.3 $price_filter = (int) $this->settings['by_price']['show']; } else { $price_filter = (int) get_option('woof_show_price_search', 0); } if ($price_filter == 1) { wp_enqueue_script('jquery-ui-core', array('jquery')); wp_enqueue_script('jquery-ui-slider', array('jquery-ui-core')); wp_enqueue_script('wc-jquery-ui-touchpunch', array('jquery-ui-core', 'jquery-ui-slider')); wp_enqueue_script('wc-price-slider', array('jquery-ui-slider', 'wc-jquery-ui-touchpunch')); } }
public function wp_head() { global $wp_query; //*** if (!isset($wp_query->query_vars['taxonomy']) and !defined('DOING_AJAX')) { $this->set_really_current_term(); } //*** ?> <?php //if (isset($this->settings['custom_css_code'])): ?> <style type="text/css"> <?php if (isset($this->settings['custom_css_code'])) { echo stripcslashes($this->settings['custom_css_code']); } ?> <?php if (isset($this->settings['overlay_skin_bg_img'])) { if (!empty($this->settings['overlay_skin_bg_img'])) { ?> .plainoverlay { background-image: url('<?php echo $this->settings['overlay_skin_bg_img']; ?> '); } <?php } } //*** if (isset($this->settings['plainoverlay_color'])) { if (!empty($this->settings['plainoverlay_color'])) { ?> .jQuery-plainOverlay-progress { border-top: 12px solid <?php echo $this->settings['plainoverlay_color']; ?> !important; } <?php } } //*** if (isset($this->settings['title_submit_image'])) { if (!empty($this->settings['title_submit_image'])) { ?> .woof_title_search_container .woof_title_search_go{ background: url(<?php echo $this->settings['title_submit_image']; ?> ) !important; } <?php } } //*** //*** if ((int) get_option('woof_autosubmit', 0)) { /* ?> .woof_price_search_container .price_slider_amount button.button{ display: none; } .woof_price_search_container .price_slider_amount .price_label{ text-align: left !important; } <?php * */ } ?> <?php if (get_option('woof_show_price_search_button', 0) == 1) { ?> <?php } else { ?> /***** START: hiding submit button of the price slider ******/ .woof_price_search_container .price_slider_amount button.button{ display: none; } .woof_price_search_container .price_slider_amount .price_label{ text-align: left !important; } .woof .widget_price_filter .price_slider_amount .button { float: left; } /***** END: hiding submit button of the price slider ******/ <?php } ?> </style> <?php //endif; ?> <?php if (!current_user_can('create_users')) { ?> <style type="text/css"> .woof_edit_view{ display: none; } </style> <?php } ?> <?php //svg preloading if (isset($this->settings['overlay_skin'])) { ?> <?php } ?> <script type="text/javascript"> var woof_is_mobile = 0; <?php if (WOOF_HELPER::is_mobile_device()) { ?> woof_is_mobile = 1; <?php } ?> var woof_show_price_search_button = 0; <?php if (get_option('woof_show_price_search_button', 0) == 1) { ?> woof_show_price_search_button = 1; <?php } ?> var swoof_search_slug = "<?php echo $this->get_swoof_search_slug(); ?> "; <?php $icheck_skin = $this->settings['icheck_skin']; ?> var icheck_skin = {}; <?php if ($icheck_skin != 'none') { ?> <?php $icheck_skin = explode('_', $icheck_skin); ?> icheck_skin.skin = "<?php echo $icheck_skin[0]; ?> "; icheck_skin.color = "<?php echo $icheck_skin[1]; ?> "; <?php } else { ?> icheck_skin = 'none'; <?php } ?> var is_woof_use_chosen =<?php echo $this->is_woof_use_chosen(); ?> ; var woof_current_page_link = location.protocol + '//' + location.host + location.pathname; //***lets remove pagination from woof_current_page_link woof_current_page_link = woof_current_page_link.replace(/\page\/[0-9]/, ""); <?php if (!isset($wp_query->query_vars['taxonomy'])) { $page_id = get_option('woocommerce_shop_page_id'); if ($page_id > 0) { $link = get_permalink($page_id); } if (is_string($link) and !empty($link)) { ?> woof_current_page_link = "<?php echo $link; ?> "; <?php } } //code bone when filter child categories on the category page of parent //like here: http://dev.pluginus.net/product-category/clothing/?swoof=1&product_cat=hoo1 if (!defined('DOING_AJAX') and !is_page()) { $request_data = $this->get_request_data(); if (isset($wp_query->query_vars['taxonomy']) and empty($request_data)) { $queried_obj = get_queried_object(); if (is_object($queried_obj)) { //$_SESSION['woof_really_current_term'] = $queried_obj; $this->set_really_current_term($queried_obj); } } } else { if ($this->is_really_current_term_exists()) { //unset($_SESSION['woof_really_current_term']); $this->set_really_current_term(); } } //+++ $woof_use_beauty_scroll = (int) get_option('woof_use_beauty_scroll', 0); ?> var woof_link = '<?php echo WOOF_LINK; ?> '; var woof_current_values = '<?php echo json_encode($this->get_request_data()); ?> '; //+++ var woof_lang_loading = "<?php _e('Loading ...', 'woocommerce-products-filter'); ?> "; <?php if (isset($this->settings['default_overlay_skin_word']) and !empty($this->settings['default_overlay_skin_word'])) { ?> woof_lang_loading = "<?php echo __($this->settings['default_overlay_skin_word'], 'woocommerce-products-filter'); ?> "; <?php } ?> var woof_lang_orderby = "<?php _e('orderby', 'woocommerce-products-filter'); ?> "; var woof_lang_title = "<?php _e('Title', 'woocommerce-products-filter'); ?> "; var woof_lang_insales = "<?php _e('In sales only', 'woocommerce-products-filter'); ?> "; var woof_lang_instock = "<?php _e('In stock only', 'woocommerce-products-filter'); ?> "; var woof_lang_perpage = "<?php _e('Per page', 'woocommerce-products-filter'); ?> "; var woof_lang_sku = "<?php _e('SKU', 'woocommerce-products-filter'); ?> "; var woof_lang_pricerange = "<?php _e('price range', 'woocommerce-products-filter'); ?> "; var woof_lang_show_products_filter = "<?php _e('show products filter', 'woocommerce-products-filter'); ?> "; var woof_lang_hide_products_filter = "<?php _e('hide products filter', 'woocommerce-products-filter'); ?> "; var woof_use_beauty_scroll =<?php echo $woof_use_beauty_scroll; ?> ; //+++ var woof_autosubmit =<?php echo (int) get_option('woof_autosubmit', 0); ?> ; var woof_ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?> "; var woof_submit_link = ""; var woof_is_ajax = 0; var woof_ajax_page_num =<?php echo get_query_var('page') ? get_query_var('page') : 1; ?> ; var woof_ajax_first_done = false; var woof_checkboxes_slide_flag = <?php echo (int) get_option('woof_checkboxes_slide') == 1 ? 'true' : 'false'; ?> ; var woof_overlay_skin = "<?php echo isset($this->settings['overlay_skin']) ? $this->settings['overlay_skin'] : 'default'; ?> "; jQuery(function () { woof_current_values = jQuery.parseJSON(woof_current_values); if (woof_current_values.length == 0) { woof_current_values = {}; } }); //*** function woof_js_after_ajax_done() { <?php echo isset($this->settings['js_after_ajax_done']) ? stripcslashes($this->settings['js_after_ajax_done']) : ''; ?> } </script> <?php if ($icheck_skin != 'none') { wp_enqueue_script('icheck-jquery', WOOF_LINK . 'js/icheck/icheck.min.js', array('jquery')); //wp_enqueue_style('icheck-jquery', self::get_application_uri() . 'js/icheck/all.css'); } /* if (is_shop()) { add_action('woocommerce_before_shop_loop', array($this, 'woocommerce_before_shop_loop')); } */ //*** wp_enqueue_script('woof_front', WOOF_LINK . 'js/front.js', array('jquery')); wp_enqueue_script('woof_radio_html_items', WOOF_LINK . 'js/html_types/radio.js', array('jquery')); wp_enqueue_script('woof_checkbox_html_items', WOOF_LINK . 'js/html_types/checkbox.js', array('jquery')); wp_enqueue_script('woof_color_html_items', WOOF_LINK . 'js/html_types/color.js', array('jquery')); wp_enqueue_script('woof_select_html_items', WOOF_LINK . 'js/html_types/select.js', array('jquery')); wp_enqueue_script('woof_mselect_html_items', WOOF_LINK . 'js/html_types/mselect.js', array('jquery')); //+++ wp_enqueue_script('woof_title_html_items', WOOF_LINK . 'js/html_types/title.js', array('jquery')); wp_enqueue_script('woof_sku_html_items', WOOF_LINK . 'js/html_types/sku.js', array('jquery')); //+++ if ($this->is_woof_use_chosen()) { wp_enqueue_script('chosen-drop-down', WOOF_LINK . 'js/chosen/chosen.jquery.min.js', array('jquery')); } if ($this->settings['overlay_skin'] != 'default') { wp_enqueue_script('plainoverlay', WOOF_LINK . 'js/plainoverlay/jquery.plainoverlay.min.js', array('jquery')); } if ($woof_use_beauty_scroll) { wp_enqueue_script('mousewheel', WOOF_LINK . 'js/malihu-custom-scrollbar/jquery.mousewheel.min.js', array('jquery')); wp_enqueue_script('malihu-custom-scrollbar', WOOF_LINK . 'js/malihu-custom-scrollbar/jquery.mCustomScrollbar.min.js', array('jquery')); wp_enqueue_script('malihu-custom-scrollbar-concat', WOOF_LINK . 'js/malihu-custom-scrollbar/jquery.mCustomScrollbar.concat.min.js', array('jquery')); } if (get_option('woof_show_price_search', 0) == 1) { wp_enqueue_script('jquery-ui-core', array('jquery')); wp_enqueue_script('jquery-ui-slider', array('jquery-ui-core')); wp_enqueue_script('wc-jquery-ui-touchpunch', array('jquery-ui-core', 'jquery-ui-slider')); wp_enqueue_script('wc-price-slider', array('jquery-ui-slider', 'wc-jquery-ui-touchpunch')); } }