PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

remove the woof JS in the <head> from pages and posts?

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi Support team, is it possible to remove the woof JS in the <head> of all the pages and posts so it only loads on the shop archive, product category,  product tag and product taxonomy? Code example attached.

I want to remove unused code and this isn't needed on all pages.

Thank you kindly for any help you can provide.

<script >
if (typeof woof_lang_custom == 'undefined') {
var woof_lang_custom = {};/*!!important*/
}
woof_lang_custom.onsales ="On sale";
</script>
<script >
var woof_is_permalink =1;

var woof_shop_page ="";

var woof_really_curr_tax = {};
var woof_current_page_link = location.protocol + '//' + location.host + location.pathname;

woof_current_page_link = woof_current_page_link.replace(/\page\/[0-9]+/,"");
woof_current_page_link ="/shop/";
var woof_link = '/wp-content/plugins/woocommerce-products-filter/';

</script>

<script>

var woof_ajaxurl ="/wp-admin/admin-ajax.php";

var woof_lang = {
'orderby':"orderby",
'date':"date",
'perpage':"per page",
'pricerange':"price range",
'menu_order':"menu order",
'popularity':"popularity",
'rating':"rating",
'price':"price low to high",
'price-desc':"price high to low"
};

if (typeof woof_lang_custom == 'undefined') {
var woof_lang_custom = {};/*!!important*/
}

var woof_is_mobile = 0;

var woof_show_price_search_button = 0;
var woof_show_price_search_type = 0;

var woof_show_price_search_type = 3;

var swoof_search_slug ="swoof";

var icheck_skin = {};
icheck_skin = 'none';

var is_woof_use_chosen =0;

var woof_current_values = '{"nowprocket":""}';

var woof_lang_loading ="Loading ...";

var woof_lang_show_products_filter ="show products filter";
var woof_lang_hide_products_filter ="hide products filter";
var woof_lang_pricerange ="price range";

var woof_use_beauty_scroll =0;

var woof_autosubmit =1;
var woof_ajaxurl ="/wp-admin/admin-ajax.php";
/*var woof_submit_link ="";*/
var woof_is_ajax = 0;
var woof_ajax_redraw = 0;
var woof_ajax_page_num =1;
var woof_ajax_first_done = false;
var woof_checkboxes_slide_flag = true;

/*toggles*/
var woof_toggle_type ="text";

var woof_toggle_closed_text ="-";
var woof_toggle_opened_text ="+";

var woof_toggle_closed_image ="/wp-content/plugins/woocommerce-products-filter/img/plus3.png";
var woof_toggle_opened_image ="/wp-content/plugins/woocommerce-products-filter/img/minus3.png";

/*indexes which can be displayed in red buttons panel*/
var woof_accept_array = ["min_price","orderby","perpage","onsales","min_rating","product_visibility","product_cat","product_tag","woo-feed-brand"];

/*for extensions*/
var woof_ext_init_functions = null;
woof_ext_init_functions = '{"by_onsales":"woof_init_onsales","slider":"woof_init_sliders"}';

var woof_overlay_skin ="default";

jQuery(function () {
try
{
woof_current_values = jQuery.parseJSON(woof_current_values);
} catch (e)
{
woof_current_values = null;
}
if (woof_current_values == null || woof_current_values.length == 0) {
woof_current_values = {};
}

});

function woof_js_after_ajax_done() {
jQuery(document).trigger('woof_ajax_done');
}
</script>

 

Hello

Please try this option -  Advanced->Options - https://share.pluginus.net/image/i20240909125617.png

Hi Support,

Thanks for pointing me in the right direction.

This setting is now Yes: Init plugin on the next site pages only

I have managed to remove the woof code from the home page by adding this to the textarea:

shop
product-category
product-tag
search

This works well but I can't figure out how to get Woof filter to load on the customer product attribute archives? I have tried adding the following but no luck. Please can you advise?

product-taxonomy
taxonomy
archive
taxonomy-gender
tax-pa_gender
taxonomies
product-taxonomies
product-tax
tax

Thanks for your help it is much appreciated

 

 

How I can't edit my previous post but I meant to ask:

I can't figure out how to get Woof filter to load on the custom product attribute archives?

If anyone can please advise how to get the Woof filter to load on all the product attribute archives that would be great.

Thank you

Hi I have figured it out!

Just add the attribute name that appears in the URL to the textarea. For example:

/gender/

Now Woof initializes on the gender product attribute archive.

Happy days!

Hello

Great!  I'm glad you were able to solve this problem.